GNOME Bugzilla – Bug 764311
gstinfo: fix file descriptor leak when default log function is not added
Last modified: 2016-04-02 11:00:59 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 on attachment 324942 [details] [review] patch fix I don't think we should be closing stdout/stderr here?
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.
Or perhaps we should never open the file in the first place if we are not going to add the function? :)
Created attachment 325139 [details] [review] more elegant patch That is a more elegant solution. I like it. Thanks for reviewing and suggesting it :)
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.