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 351502 - g_value_set_string leaks
g_value_set_string leaks
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Linux
: Normal normal
: 0.10.10
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2006-08-15 17:05 UTC by Paolo Borelli
Modified: 2006-08-15 19:31 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Paolo Borelli 2006-08-15 17:05:11 UTC
paolo@murdock:~/cvs/gnome2/gst-plugins-base$ rgrep g_value_set_string.*g_strdup . | grep -v binar
./sys/ximage/ximagesink.c:      g_value_set_string (value, g_strdup (ximagesink->display_name));
./sys/xvimage/xvimagesink.c:      g_value_set_string (value, g_strdup (xvimagesink->display_name));


paolo@murdock:~/cvs/gnome2/gst-plugins-bad$ rgrep g_value_set_string.*g_strdup . | grep -v binar
./ext/libfame/gstlibfame.c:      g_value_set_string (value, g_strdup (fameenc->pattern));
./sys/glsink/glimagesink.c:      g_value_set_string (value, g_strdup (glimage_sink->display_name));


g_value_set_string dups the string itself, so the strdup should be dropped to avoid leaking memory.
Comment 1 Tim-Philipp Müller 2006-08-15 19:31:06 UTC
Fixed, thanks:

-core:

 2006-08-15  Tim-Philipp Müller  <tim at centricular dot net>

        * gst/gstutils.c: (gst_util_set_value_from_string):
          Fix memleak (#351502).

        * tests/check/gst/gstutils.c: (GST_START_TEST), (gst_utils_suite):
          Add unit test for most of gst_util_set_value_from_string()
          (not that one would want to encourage use of this function).

-base:

 2006-08-15  Tim-Philipp Müller  <tim at centricular dot net>

       * sys/ximage/ximagesink.c: (gst_ximagesink_get_property):
       * sys/xvimage/xvimagesink.c: (gst_xvimagesink_get_property):
         Fix leak (#351502).

-bad:

 2006-08-15  Tim-Philipp Müller  <tim at centricular dot net>

        * ext/libfame/gstlibfame.c: (gst_fameenc_get_property):
        * sys/glsink/glimagesink.c: (gst_glimage_sink_get_property):
          Fix leaks (#351502).