[gimp] Revert "file-xpm: Plug a leak"



commit f76c6e299750c10f307f6ac30bbbaca949e945ae
Author: Mukund Sivaraman <muks banu com>
Date:   Wed Oct 12 18:25:17 2011 +0530

    Revert "file-xpm: Plug a leak"
    
    This reverts commit cea29187f796cfd586e0e7bb8e9374bebbd91556.

 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 c980b22..2a8ed67 100644
--- a/plug-ins/common/file-xpm.c
+++ b/plug-ins/common/file-xpm.c
@@ -667,11 +667,10 @@ save_image (const gchar  *filename,
           /* do each pixel in the row */
           for (k = 0; k < width; k++)
             {
-              rgbkey *key;
+              rgbkey *key = g_new (rgbkey, 1);
               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;
@@ -695,6 +694,7 @@ 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]