GNOME Bugzilla – Bug 360134
couple of leaks in e-text
Last modified: 2008-02-18 09:56:30 UTC
in evolution/widgets/text/e-text.c:e_text_get_property() case PROP_TEXT: g_value_set_string (value, g_strdup (text->text)); break; ... case PROP_ELLIPSIS: g_value_set_string (value, g_strdup (text->ellipsis)); break; g_value_set_string dups the string itself so the g_strdup should be removed to avoid leaking memory.
The documentation says: g_value_set_static_string() (GValue *value, const gchar *v_string); Set the contents of a G_TYPE_STRING GValue to v_string. The string is assumed to be static, and is thus not duplicated when setting the GValue. That implies that g_value_set_string dups it. I found a few more locations where g_strdup is used in g_value_set_string and I think I got them all.
Created attachment 96968 [details] [review] Patch which removes g_strdup inside g_set_value_string
Fine to commit.
committed as r34377
(In reply to comment #4) > committed as r34377 > Please do change the patch-status to 'committed' when the patch is committed to SVN.