summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBert Münnich <ber.t@posteo.de>2014-10-31 10:37:35 +0100
committerBert Münnich <ber.t@posteo.de>2014-10-31 10:37:35 +0100
commitf5f49e7a9deabd83303a7490cf606fb200c8af81 (patch)
treed3fb1da823e5acfa6eaefe85d0914e746ccb8ea6
parent25077ac764819f1b555044e54d6bf6b2a1c79aeb (diff)
downloadnsxiv-f5f49e7a9deabd83303a7490cf606fb200c8af81.tar.zst
Fixed leakage of resources allocated by EXIF library
-rw-r--r--Makefile2
-rw-r--r--thumbs.c8
2 files changed, 5 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 2741601..c1ef1a8 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-VERSION = git-20141029
+VERSION = git-20141031
PREFIX = /usr/local
MANPREFIX = $(PREFIX)/share/man
diff --git a/thumbs.c b/thumbs.c
index a8f498b..3e6cc88 100644
--- a/thumbs.c
+++ b/thumbs.c
@@ -276,10 +276,10 @@ bool tns_load(tns_t *tns, int n, bool force)
char tmppath[] = "/tmp/sxiv-XXXXXX";
Imlib_Image tmpim;
- if ((ed = exif_data_new_from_file(file->path)) != NULL &&
- ed->data != NULL && ed->size > 0)
- {
- if ((tmpfd = mkstemp(tmppath)) >= 0) {
+ if ((ed = exif_data_new_from_file(file->path)) != NULL) {
+ if (ed->data != NULL && ed->size > 0 &&
+ (tmpfd = mkstemp(tmppath)) >= 0)
+ {
err = write(tmpfd, ed->data, ed->size) != ed->size;
close(tmpfd);