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 730010 - gst-play: audio_sink and video_sink strings are not freed
gst-play: audio_sink and video_sink strings are not freed
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
1.x
Other Linux
: Normal normal
: 1.3.2
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-05-12 14:02 UTC by Anuj
Modified: 2014-05-19 09:18 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
freeing of two pointers in tools/gst-play.c (2.12 KB, patch)
2014-05-13 06:04 UTC, Anuj
needs-work Details | Review
fixed the leakages in main() (1.14 KB, patch)
2014-05-13 08:37 UTC, Anuj
committed Details | Review

Description Anuj 2014-05-12 14:02:20 UTC
audio_sink pointer and video_sink pointer are not set free.
Comment 1 Sebastian Dröge (slomo) 2014-05-12 14:13:06 UTC
Thanks for taking the time to report this bug.
This bug report isn't very useful because it doesn't describe the bug well. If you have time and can still reproduce the bug, please read http://bugzilla.gnome.org/bug-HOWTO.html and add a more useful description to this bug.
Comment 2 Anuj 2014-05-13 05:58:34 UTC
tools/gst-play.c it takes input media/files from command line.
proper cleaning of the memory was not done for 2 pointers audio_sink and video_sink.
Did freeing of these 2 pointers and tested it.
Its working fine.
Changes made are :

  g_free (audio_sink);
  g_free (video_sink);

please review.
Comment 3 Anuj 2014-05-13 06:04:13 UTC
Created attachment 276437 [details] [review]
freeing of two pointers in tools/gst-play.c
Comment 4 Sebastian Dröge (slomo) 2014-05-13 07:16:43 UTC
Review of attachment 276437 [details] [review]:

::: tools/gst-play.c
@@ +790,3 @@
 
+  g_free (audio_sink);
+  g_free (video_sink);

While this is correct, it would probably be more consistent to free them inside play_free(). Also in the "early return" cases in main() these strings would still be leaked, together with e.g. the playlist_file string
Comment 5 Tim-Philipp Müller 2014-05-13 07:55:02 UTC
> it would probably be more consistent to free them inside play_free()

Not really, since those strings are not stored in the GstPlay structure.
Comment 6 Anuj 2014-05-13 08:37:18 UTC
Fixed the leakages in early returns of main().
please review.
Comment 7 Anuj 2014-05-13 08:37:50 UTC
Created attachment 276445 [details] [review]
fixed the leakages in main()
Comment 8 Sebastian Dröge (slomo) 2014-05-19 09:18:20 UTC
commit 86c698a46f7efa5f106633f0d8c69683bd03aef2
Author: Sebastian Dröge <sebastian@centricular.com>
Date:   Mon May 19 11:17:33 2014 +0200

    gst-play: Free playlist_file string if only printing the version

commit 59131a4ceb8484b5603123b102732770e4e49d22
Author: Anuj Jaiswal <anuj.jaiswal@samsung.com>
Date:   Tue May 13 14:08:20 2014 +0600

    audio_sink and video_sink leakage fixed
    
    https://bugzilla.gnome.org/show_bug.cgi?id=730010