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>
This commit is contained in:
Stefan Weil 2017-12-15 16:49:33 +01:00
parent 9d0d1a0128
commit 4841292b5d
1 changed files with 3 additions and 0 deletions

View File

@ -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++) {