Commit 5e8b4a81 authored by Bastien Nocera's avatar Bastien Nocera

mindtct: Fix leak in pixelize_map()

pmap was not freed in error cases.

Spotted by Seth Arnold

Closes: #83
parent 21a77923
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment