projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
open, fopen: close fd leak in last patch
[pspp]
/
lib
/
fopen.c
diff --git
a/lib/fopen.c
b/lib/fopen.c
index f64122b9f167c50f9ef61f8c40b796938d0a6b60..d6e048b79b6b43fa90ded109811a95926be9a740 100644
(file)
--- a/
lib/fopen.c
+++ b/
lib/fopen.c
@@
-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;
}