Krolyxon
Commit f5f49e7

Branches

Refs →

nsxivf5f49e7

Fixed leakage of resources allocated by EXIF library

Author
Bert Münnich
Date
2014-10-31 10:37 +0100
Parent
25077ac
Commit
f5f49e7a9deabd83303a7490cf606fb200c8af81

+5 −5

2 files changed

  1. M Makefile +1 −1
  2. M thumbs.c +4 −4
M Makefile View
@@ -1,4 +1,4 @@
1−VERSION = git-20141029
1+VERSION = git-20141031
22
33 PREFIX = /usr/local
44 MANPREFIX = $(PREFIX)/share/man
M thumbs.c View
@@ -276,10 +276,10 @@ bool tns_load(tns_t *tns, int n, bool force)
276276 char tmppath[] = "/tmp/sxiv-XXXXXX";
277277 Imlib_Image tmpim;
278278
279− if ((ed = exif_data_new_from_file(file->path)) != NULL &&
280− ed->data != NULL && ed->size > 0)
281− {
282− if ((tmpfd = mkstemp(tmppath)) >= 0) {
279+ if ((ed = exif_data_new_from_file(file->path)) != NULL) {
280+ if (ed->data != NULL && ed->size > 0 &&
281+ (tmpfd = mkstemp(tmppath)) >= 0)
282+ {
283283 err = write(tmpfd, ed->data, ed->size) != ed->size;
284284 close(tmpfd);
285285