mindtct: Fix leak in pixelize_map()

pmap was not freed in error cases.

Spotted by Seth Arnold

Closes: #83
This commit is contained in:
Bastien Nocera 2018-09-28 16:11:52 +02:00
parent 21a779235d
commit 5e8b4a81e9

View file

@ -736,11 +736,13 @@ int pixelize_map(int **omap, const int iw, const int ih,
}
if((ret = block_offsets(&blkoffs, &bw, &bh, iw, ih, 0, blocksize))){
free(pmap);
return(ret);
}
if((bw != mw) || (bh != mh)){
free(blkoffs);
free(pmap);
fprintf(stderr,
"ERROR : pixelize_map : block dimensions do not match\n");
return(-591);