[Bf-blender-cvs] [d56111383a9] blender-v2.83-release: Fix memory leak writing PNG when opening the file fails

Campbell Barton noreply at git.blender.org
Wed Dec 2 08:50:18 CET 2020


Commit: d56111383a9907ebde9f5b05ce7c6e91dde4ebf0
Author: Campbell Barton
Date:   Fri Nov 13 11:34:53 2020 +1100
Branches: blender-v2.83-release
https://developer.blender.org/rBd56111383a9907ebde9f5b05ce7c6e91dde4ebf0

Fix memory leak writing PNG when opening the file fails

===================================================================

M	source/blender/imbuf/intern/png.c

===================================================================

diff --git a/source/blender/imbuf/intern/png.c b/source/blender/imbuf/intern/png.c
index 9e600f363c5..3ce575f5267 100644
--- a/source/blender/imbuf/intern/png.c
+++ b/source/blender/imbuf/intern/png.c
@@ -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;
     }



More information about the Bf-blender-cvs mailing list