From 2e08500d047e830ceeb651466cae0140d31fe9a4 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 13 Nov 2020 11:34:53 +1100 Subject: Fix memory leak writing PNG when opening the file fails --- source/blender/imbuf/intern/png.c | 1 + 1 file changed, 1 insertion(+) diff --git a/source/blender/imbuf/intern/png.c b/source/blender/imbuf/intern/png.c index dbae641f707..0104d7e2f17 100644 --- a/source/blender/imbuf/intern/png.c +++ b/source/blender/imbuf/intern/png.c @@ -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; } -- cgit v1.2.3