nsxivf5f49e7
Fixed leakage of resources allocated by EXIF library
+5 −5
2 files changed
| @@ -1,4 +1,4 @@ | |||
| 1 | − | VERSION = git-20141029 | |
| 1 | + | VERSION = git-20141031 | |
| 2 | 2 | ||
| 3 | 3 | PREFIX = /usr/local | |
| 4 | 4 | MANPREFIX = $(PREFIX)/share/man | |
| @@ -276,10 +276,10 @@ bool tns_load(tns_t *tns, int n, bool force) | |||
| 276 | 276 | char tmppath[] = "/tmp/sxiv-XXXXXX"; | |
| 277 | 277 | Imlib_Image tmpim; | |
| 278 | 278 | ||
| 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 | + | { | |
| 283 | 283 | err = write(tmpfd, ed->data, ed->size) != ed->size; | |
| 284 | 284 | close(tmpfd); | |
| 285 | 285 | ||