After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 360134 - couple of leaks in e-text
couple of leaks in e-text
Status: RESOLVED FIXED
Product: evolution
Classification: Applications
Component: general
2.8.x (obsolete)
Other Linux
: Normal normal
: ---
Assigned To: Evolution Shell Maintainers Team
Evolution QA team
Depends on:
Blocks:
 
 
Reported: 2006-10-06 11:53 UTC by Paolo Borelli
Modified: 2008-02-18 09:56 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch which removes g_strdup inside g_set_value_string (3.00 KB, patch)
2007-10-09 22:10 UTC, Tobias Mueller
committed Details | Review

Description Paolo Borelli 2006-10-06 11:53:16 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.
Comment 1 Tobias Mueller 2007-10-09 22:08:54 UTC
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.
Comment 2 Tobias Mueller 2007-10-09 22:10:14 UTC
Created attachment 96968 [details] [review]
Patch which removes g_strdup inside g_set_value_string
Comment 3 Srinivasa Ragavan 2007-10-11 05:32:26 UTC
Fine to commit.
Comment 4 Tobias Mueller 2007-10-11 19:12:06 UTC
committed as r34377
Comment 5 Suman Manjunath 2008-02-18 09:56:30 UTC
(In reply to comment #4)
> committed as r34377
> 

Please do change the patch-status to 'committed' when the patch is committed to SVN.