Commit 2912fe7c authored by Jehan's avatar Jehan

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!
parent 0ab682b0
......@@ -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))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment