summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEkho <ekho@ekho.email>2021-01-04 21:16:19 +0000
committerEkho <ekho@ekho.email>2021-01-04 21:16:19 +0000
commit859c3061ad75ae357c9526af850e86cc156efb82 (patch)
treef2f8ab38f612832b2d75c7cf7ba992bc0b57f2f8
parent1a8734a22666d4084c89f65f66e233fec5064d13 (diff)
Fix truncated image file descriptor leak
Fixes https://github.com/derf/feh/issues/580
-rw-r--r--src/imlib.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/imlib.c b/src/imlib.c
index 2c629f5..35b9bd0 100644
--- a/src/imlib.c
+++ b/src/imlib.c
@@ -238,6 +238,7 @@ int feh_is_image(feh_file * file)
return 0;
}
if (fread(buf, 1, 16, fh) != 16) {
+ fclose(fh);
return 0;
}
fclose(fh);