Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8345267

Fix memory leak in JVMCIEnv dtor

XMLWordPrintable

    • b27

      The JVMCIEnv destructor calls free() on the _init_error_msg, if it has one. free() is normally a forbidden C function (should be using os::malloc and os::free instead), so the call to free() is wrapped in ALLOW_C_FUNCTION. But that wrapping is done incorrectly. That macro takes the identifier for the relevant C function, followed by a statement containing the use as additional (variadic) macro args. But in this place the the first argument is the free expression and there are no further arguments. Since the macro currently ignores its first (identifier) argument, this use expands to no useful code, without the indended call to free().

            dnsimon Douglas Simon
            kbarrett Kim Barrett
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: