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 753853 - gstreamer: good: Fix memory leaks when context parse fails.
gstreamer: good: Fix memory leaks when context parse fails.
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal normal
: 1.7.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-08-20 02:02 UTC by Vineeth
Modified: 2015-10-02 14:35 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gstreamer:good:tests: fix memory leaks during context parse failures. (5.21 KB, patch)
2015-08-20 02:04 UTC, Vineeth
committed Details | Review

Description Vineeth 2015-08-20 02:02:11 UTC
In all places where g_option_context_parse is being used, when it fails, the context and error variables are not getting freed, which will result in memory leaks.
Along with that replacing g_error_free with g_clear_error in these files, which is a better way to free error, as it checks if the variable is Non-NULL and then sets it to NULL on freeing.
Comment 1 Vineeth 2015-08-20 02:04:00 UTC
Created attachment 309662 [details] [review]
gstreamer:good:tests: fix memory leaks during context parse failures.
Comment 2 Sebastian Dröge (slomo) 2015-08-20 06:50:30 UTC
Thanks, but please squash all the commits into one
Comment 3 Vineeth 2015-08-20 07:07:15 UTC
This is already a single patch :)
Comment 4 Sebastian Dröge (slomo) 2015-08-20 07:10:28 UTC
Comment on attachment 309662 [details] [review]
gstreamer:good:tests: fix memory leaks during context parse failures.

Sorry :)
Comment 5 Sebastian Dröge (slomo) 2015-10-02 14:35:36 UTC
commit 290f8be15a1a66c0b2480a9332d3e0c24ab994d1
Author: Vineeth TM <vineeth.tm@samsung.com>
Date:   Thu Aug 20 11:02:58 2015 +0900

    gstreamer: good: tests: Fix memory leaks when context parse fails.
    
    When g_option_context_parse fails, context and error variables are not getting free'd
    which results in memory leaks. Free'ing the same.
    
    And replacing g_error_free with g_clear_error, which checks if the error being passed
    
    https://bugzilla.gnome.org/show_bug.cgi?id=753853