aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/drivers/unix/unix_efile.c
diff options
context:
space:
mode:
authorRaimo Niskanen <[email protected]>2017-03-29 11:50:06 +0200
committerRaimo Niskanen <[email protected]>2017-03-29 11:50:06 +0200
commit0de8b6897b15b9ee881b42ad96b0720f9c17b556 (patch)
tree4317c7dc84dea5488596a38b5595f8b72d395b50 /erts/emulator/drivers/unix/unix_efile.c
parenta748cafdc7063d9f181ba12088db6458793ced2f (diff)
downloadotp-0de8b6897b15b9ee881b42ad96b0720f9c17b556.tar.gz
otp-0de8b6897b15b9ee881b42ad96b0720f9c17b556.tar.bz2
otp-0de8b6897b15b9ee881b42ad96b0720f9c17b556.zip
Close FD after trying to open a directory
Diffstat (limited to 'erts/emulator/drivers/unix/unix_efile.c')
-rw-r--r--erts/emulator/drivers/unix/unix_efile.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/erts/emulator/drivers/unix/unix_efile.c b/erts/emulator/drivers/unix/unix_efile.c
index 3ff68a8859..0acc2432a7 100644
--- a/erts/emulator/drivers/unix/unix_efile.c
+++ b/erts/emulator/drivers/unix/unix_efile.c
@@ -430,6 +430,9 @@ efile_openfile(Efile_error* errInfo, /* Where to return error codes. */
if ( (stat("/dev/null", &nullstatbuf) < 0)
|| (statbuf.st_ino != nullstatbuf.st_ino)
|| (statbuf.st_dev != nullstatbuf.st_dev) ) {
+#ifdef HAVE_FSTAT
+ efile_closefile(fd);
+#endif
errno = EISDIR;
return check_error(-1, errInfo);
}