open, fopen: close fd leak in last patch
[pspp] / lib / fopen.c
index f64122b9f167c50f9ef61f8c40b796938d0a6b60..d6e048b79b6b43fa90ded109811a95926be9a740 100644 (file)
@@ -72,6 +72,7 @@ rpl_fopen (const char *filename, const char *mode)
 
        if (fstat (fd, &statbuf) >= 0 && !S_ISDIR (statbuf.st_mode))
          {
+           close (fd);
            errno = ENOTDIR;
            return NULL;
          }