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 764311 - gstinfo: fix file descriptor leak when default log function is not added
gstinfo: fix file descriptor leak when default log function is not added
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other All
: Normal minor
: 1.9.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-03-29 14:54 UTC by Luis de Bethencourt
Modified: 2016-04-02 11:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch fix (736 bytes, patch)
2016-03-29 14:54 UTC, Luis de Bethencourt
none Details | Review
True! We only want to close it if it is a file (with g_fopen) and it hasn't been added to log function (823 bytes, patch)
2016-03-31 10:50 UTC, Luis de Bethencourt
none Details | Review
more elegant patch (2.04 KB, patch)
2016-04-01 10:15 UTC, Luis de Bethencourt
committed Details | Review

Description Luis de Bethencourt 2016-03-29 14:54:19 UTC
Created attachment 324942 [details] [review]
patch fix

There is a small memory leak in gstinfo. This patch solves it. Submitting it here for review before merging.
Comment 1 Tim-Philipp Müller 2016-03-29 20:09:55 UTC
Comment on attachment 324942 [details] [review]
patch fix

I don't think we should be closing stdout/stderr here?
Comment 2 Luis de Bethencourt 2016-03-31 10:50:50 UTC
Created attachment 325073 [details] [review]
True! We only want to close it if it is a file (with g_fopen) and it hasn't been added to log function

My bad.
Comment 3 Tim-Philipp Müller 2016-03-31 16:39:36 UTC
Or perhaps we should never open the file in the first place if we are not going to add the function? :)
Comment 4 Luis de Bethencourt 2016-04-01 10:15:26 UTC
Created attachment 325139 [details] [review]
more elegant patch

That is a more elegant solution. I like it.

Thanks for reviewing and suggesting it :)
Comment 5 Luis de Bethencourt 2016-04-02 09:49:05 UTC
Review of attachment 325139 [details] [review]:

commit 1bb699446af3129f4647fd1504bd32574e060b2c
Author: Luis de Bethencourt <luisbg@osg.samsung.com>
Date:   Thu Mar 31 11:46:03 2016 +0100

    info: only open log file when adding it to the log function

    This avoids the leak of opening it and then not passing it or closing it
    before it goes out of scope.