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

Use-after-free on failure path in LinuxPackage.c, getJvmLauncherLibPath

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P4
    • 17
    • 17
    • tools
    • b09

    Description

      SonarCloud instance reports a new warning after JDK-8254702:
       "Use of memory after it is freed"

      char* getJvmLauncherLibPath(void) {
             ...
              popenStatus = popenCommand(pkgQueryCmd, pkg->name, findLauncherLib,
                                                              &launcherLibPath);
              if (popenStatus) {
                  free(launcherLibPath); <---- frees here
                  goto cleanup;
              }
          }

      cleanup:
          free(modulePath);
          freePackageDesc(pkg);

          return launcherLibPath; <--- here
      }

      Attachments

        Issue Links

          Activity

            People

              shade Aleksey Shipilev
              shade Aleksey Shipilev
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: