[gimp] plug-ins: fix memory leak in file-mng



commit 0357f83658252952770a79ab17c7056fb5dd0416
Author: Michael Henning <drawoc darkrefraction com>
Date:   Thu Jan 17 19:23:15 2013 -0500

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

 plug-ins/common/file-mng.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/plug-ins/common/file-mng.c b/plug-ins/common/file-mng.c
index a022543..5278ae0 100644
--- a/plug-ins/common/file-mng.c
+++ b/plug-ins/common/file-mng.c
@@ -469,7 +469,9 @@ respin_cmap (png_structp  pp,
   /* Make sure there is something in the colormap */
   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]