GNOME Bugzilla – Bug 640071
pluginloader: do not leak the description string of blacklisted plugin
Last modified: 2011-01-24 16:50:04 UTC
Do not leak the description string. It's assigned to a const pointer in the first place.
Created attachment 178843 [details] [review] gstpluginloader: do not leak the description string
Comment on attachment 178843 [details] [review] gstpluginloader: do not leak the description string > plugin->basename = g_path_get_basename (plugin->filename); > plugin->desc.name = g_intern_string (plugin->basename); >- plugin->desc.description = g_strdup_printf ("Plugin for blacklisted file"); >+ plugin->desc.description = "Plugin for blacklisted file"; > plugin->desc.version = g_intern_string ("0.0.0"); > plugin->desc.license = g_intern_string ("BLACKLIST"); > plugin->desc.source = plugin->desc.license; >-- This should probably be interned as well, for clarity and consistency (though I admit I can't really see why these string constants need to be interned at all - if not, we should probably change the others as well then, or at least use g_intern_static_string()).
Created attachment 178862 [details] [review] gstpluginloader: do not leak the description string A version which interns the relevant strings, if deemed more appropriate.
Thanks, pushed a version that just assigns the const strings, since slomo also agreed that there's no need to intern those: commit 6b84f4573c876fb59c153bf082f2e9bdc9875f88 Author: Vincent Penquerc'h <vincent.penquerch@collabora.co.uk> Date: Thu Jan 20 14:37:25 2011 +0000 gstpluginloader: do not leak the description string The description string was changed to an inlined string a while back. (But: no need to intern the const strings here, we just use the interning to avoid allocating duplicates and make memory management easier, since the strings will be around for the life-time of the app anyway). https://bugzilla.gnome.org/show_bug.cgi?id=640071