[gimp/soc-2011-seamless-clone2] plug-ins: fix a memory leak in file-png



commit 1afa0a2cb8adf03967ed1fb39e374fca482c1c4c
Author: Michael Henning <drawoc darkrefraction com>
Date:   Mon Jan 14 17:36:43 2013 -0500

    plug-ins: fix a memory leak in file-png
    
    Found using clang's scan-build.

 plug-ins/common/file-png.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/plug-ins/common/file-png.c b/plug-ins/common/file-png.c
index d19f63f..e47c639 100644
--- a/plug-ins/common/file-png.c
+++ b/plug-ins/common/file-png.c
@@ -1868,7 +1868,9 @@ respin_cmap (png_structp   pp,
    */
   if (colors == 0)
     {
-      before = g_new0 (guchar, 3);
+      before = g_newa (guchar, 3);
+      memset (before, 0, sizeof (guchar) * 3);
+
       colors = 1;
     }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]