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

Memory leak when malloc fails within WITH_UNICODE_STRING block

XMLWordPrintable

    • b03
    • windows
    • Not verified

        File src/java.base/windows/native/libjava/io_util_md.c

        In pathToNTPath() a pair of macros WITH_UNICODE_STRING / END_UNICODE_STRING is used.

        The former calls (*env)->GetStringChars() to acquire the string array, and the later calls (*env)->ReleaseStringChars().

        Within this block memory is allocated with malloc(), and if that fails, we return from the pathToNTPath() without releasing the string array.

              igerasim Ivan Gerasimov
              igerasim Ivan Gerasimov
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: