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

Potential open file descriptor in exists() of hotspot/agent/src/os/bsd/ps_core.c

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 9
    • None
    • hotspot
    • b150

      bool exists(const char *fname)
      {
        int fd;
        if ((fd = open(fname, O_RDONLY)) > 0) {
          close(fd);
          return true;
        }
        return false;
      }
       
      The above code snippet could potentially leave a file descriptor open if 'fd' returns a zero.

            jgeorge Jini George (Inactive)
            jgeorge Jini George (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: