mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
Fix a another memory leak in etctool.
imgdec = (unsigned char*) malloc(expandedwidth*expandedheight*3); is called before the if statement "if((f=fopen(dstfile,"wb")))" If the file 'f' failed in the if statement, it would never be freed (since "free(imgdec)" was within that if block.
This commit is contained in:
1 parent
5b5eec793f
commit
366de9f248
1 file changed
+3
-2
@@ -612,9 +612,10 @@ void compressImageFile(uint8 *img,int width,int height,char *dstfile, int expand
|
||||
printf("\n");
|
||||
|
||||
fclose(f);
|
||||
free(imgdec);
|
||||
printf("Saved file <%s>.\n",dstfile);
|
||||
printf("Saved file <%s>.\n",dstfile);
|
||||
}
|
||||
|
||||
free(imgdec);
|
||||
}
|
||||
|
||||
double calculatePSNR(uint8 *lossyimg, uint8 *origimg, int width, int height)
|
||||
|
||||
Reference in new issue
Block a user