[gimp] file-xpm: Plug a leak



commit cea29187f796cfd586e0e7bb8e9374bebbd91556
Author: Mukund Sivaraman <muks banu com>
Date:   Wed Oct 12 16:51:11 2011 +0530

    file-xpm: Plug a leak

 plug-ins/common/file-xpm.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/plug-ins/common/file-xpm.c b/plug-ins/common/file-xpm.c
index 2a8ed67..c980b22 100644
--- a/plug-ins/common/file-xpm.c
+++ b/plug-ins/common/file-xpm.c
@@ -667,10 +667,11 @@ save_image (const gchar  *filename,
           /* do each pixel in the row */
           for (k = 0; k < width; k++)
             {
-              rgbkey *key = g_new (rgbkey, 1);
+              rgbkey *key;
               guchar  a;
 
               /* get pixel data */
+              key = g_new (rgbkey, 1);
               key->r = *(data++);
               key->g = color && !indexed ? *(data++) : key->r;
               key->b = color && !indexed ? *(data++) : key->r;
@@ -694,7 +695,6 @@ save_image (const gchar  *filename,
                           indexno = g_new (gint, 1);
                           *indexno = ncolors++;
                           g_hash_table_insert (hash, key, indexno);
-                          key = g_new (rgbkey, 1);
                         }
                       *(idata++) = *indexno;
                     }



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