summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@mines-paris.org>2018-01-07 17:49:37 +0100
committerGitHub <noreply@github.com>2018-01-07 17:49:37 +0100
commitbdcead70d5900cf5b90774b218183334ca898723 (patch)
tree009361d7746c264cc1c72ac47c0facd4a1680ac9 /src
parente4c3595077b2a38579c32f2c63bb01d5213b64d2 (diff)
parent4841292b5df8f5ed3c92f1760769428ad7500b7a (diff)
Merge pull request #1047 from stweil/coverity
Fix resource leak (CID 179466)
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++) {