Revert "file-xpm: Plug a leak"

This reverts commit cea29187f7.
This commit is contained in:
Mukund Sivaraman 2011-10-12 18:25:17 +05:30
parent 7b9f0037ef
commit f76c6e2997
1 changed files with 2 additions and 2 deletions

View File

@ -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;
}