Issue #1974: Memory leak in gimpimage.c.
Ok my previous fix was wrong (at least for the part in the macro). This is a macro, not a function. So each time we write _reason, the call to g_strdup_printf() is reevaluated, hence data is allocated. The right fix is to prepend `tmp` to the list, not `_reason`. Thanks to Massimo for the debugging, as always!
This commit is contained in:
@ -2373,8 +2373,7 @@ gimp_image_get_xcf_version (GimpImage *image,
|
||||
if (g_list_find_custom (reasons, tmp, (GCompareFunc) strcmp)) \
|
||||
g_free (tmp); \
|
||||
else \
|
||||
reasons = g_list_prepend (reasons, (_reason)); } \
|
||||
else g_free (_reason);
|
||||
reasons = g_list_prepend (reasons, tmp); }
|
||||
|
||||
/* need version 1 for colormaps */
|
||||
if (gimp_image_get_colormap (image))
|
||||
|
||||
Reference in New Issue
Block a user