summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStefan Weil <sw@weilnetz.de>2017-12-15 16:49:33 +0100
committerStefan Weil <sw@weilnetz.de>2017-12-15 16:49:33 +0100
commit4841292b5df8f5ed3c92f1760769428ad7500b7a (patch)
tree615e1039f5954ce9db13023f9406a7921d9efc39 /src
parent9d0d1a0128c7a9324c9a935b2ded01deb4d660d4 (diff)
Fix resource leak (CID 179466)
Coverity report: CID 179466 (#1 of 1): Resource leak (RESOURCE_LEAK) 93. leaked_storage: Variable name going out of scope leaks the storage it points to. Signed-off-by: Stefan Weil <sw@weilnetz.de>
Diffstat (limited to 'src')
-rw-r--r--src/bin/jp2/convert.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/bin/jp2/convert.c b/src/bin/jp2/convert.c
index 7040969d..26af53f2 100644
--- a/src/bin/jp2/convert.c
+++ b/src/bin/jp2/convert.c
@@ -1416,6 +1416,9 @@ int imagetopgx(opj_image_t * image, const char *outfile)
unsigned char* line_buffer = malloc((size_t)w);
if (line_buffer == NULL) {
fprintf(stderr, "Out of memory");
+ if (total > 256) {
+ free(name);
+ }
goto fin;
}
for (j = 0; j < h; j++) {