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 640071 - pluginloader: do not leak the description string of blacklisted plugin
pluginloader: do not leak the description string of blacklisted plugin
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
unspecified
Other All
: Normal normal
: 0.10.33
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-01-20 14:39 UTC by Vincent Penquerc'h
Modified: 2011-01-24 16:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gstpluginloader: do not leak the description string (1.01 KB, patch)
2011-01-20 14:39 UTC, Vincent Penquerc'h
reviewed Details | Review
gstpluginloader: do not leak the description string (1.33 KB, patch)
2011-01-20 18:11 UTC, Vincent Penquerc'h
reviewed Details | Review

Description Vincent Penquerc'h 2011-01-20 14:39:51 UTC
Do not leak the description string.
It's assigned to a const pointer in the first place.
Comment 1 Vincent Penquerc'h 2011-01-20 14:39:53 UTC
Created attachment 178843 [details] [review]
gstpluginloader: do not leak the description string
Comment 2 Tim-Philipp Müller 2011-01-20 17:45:30 UTC
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()).
Comment 3 Vincent Penquerc'h 2011-01-20 18:11:37 UTC
Created attachment 178862 [details] [review]
gstpluginloader: do not leak the description string

A version which interns the relevant strings, if deemed more appropriate.
Comment 4 Tim-Philipp Müller 2011-01-24 16:47:59 UTC
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