Fix memory leak writing PNG when opening the file fails

This commit is contained in:
Campbell Barton 2020-11-13 11:34:53 +11:00 • committed by Jeroen Bakker
parent 13b02a724f
commit d56111383a

View file

@ -405,6 +405,7 @@ int imb_savepng(struct ImBuf *ibuf, const char *name, int flags)
if (pixels16) {
MEM_freeN(pixels16);
}
MEM_freeN(row_pointers);
printf("imb_savepng: Cannot open file for writing: '%s'\n", name);
return 0;
}