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

jabswitch.cpp: regEnable and regDeleteValue leak newStr

XMLWordPrintable

      The code in `regEnable` [1] and `regDeleteValue` [2] functions allocate newStr to format data and then write the data to registry but the `delete[]` operator is never called for `newStr`.

      The bug is found during code review [3] for JDK-8342870.


      [1] https://github.com/openjdk/jdk/blob/4a9fba615da0dfa6646ecb9fd9d929f74fe6875e/src/jdk.accessibility/windows/native/jabswitch/jabswitch.cpp#L352
      [2] https://github.com/openjdk/jdk/blob/4a9fba615da0dfa6646ecb9fd9d929f74fe6875e/src/jdk.accessibility/windows/native/jabswitch/jabswitch.cpp#L396
      [3] https://github.com/openjdk/jdk/pull/21656#discussion_r1923752261

            aivanov Alexey Ivanov
            aivanov Alexey Ivanov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: