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

Memory leak when malloc fails within WITH_UNICODE_STRING block

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 12
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      master
    • OS:
      windows

      Backports

        Description

        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.

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  igerasim Ivan Gerasimov
                  Reporter:
                  igerasim Ivan Gerasimov
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: