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
parent d59fa12f2a
commit 2e08500d04

View File

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