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 788481 - libav : Fix for memory leak in function gst_ffmpegdata_open if successive memory allocations fail
libav : Fix for memory leak in function gst_ffmpegdata_open if successive mem...
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-libav
1.12.3
Other All
: Normal normal
: 1.13.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-10-03 17:05 UTC by Ashish Kumar
Modified: 2018-01-13 12:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch to fix the memory leak. (1.13 KB, patch)
2017-10-03 17:05 UTC, Ashish Kumar
none Details | Review

Description Ashish Kumar 2017-10-03 17:05:22 UTC
Created attachment 360848 [details] [review]
patch to fix the memory leak.

Hi
In function gst_ffmpegdata_open 
 info = g_new0 (GstProtocolInfo, 1); 
not freed in case of  
 return -EINVAL;
and
return -ENOMEM;


Solution : g_free(info);


Attached the patch for the same.
Please review and share the feedback.
Comment 1 Tim-Philipp Müller 2018-01-13 12:07:26 UTC
Thanks for the patch. Next time please make sure to run gst-indent on the .c file you have modified (this is done automatically on git commit if you are working on a git checkout and have GNU indent installed).

commit a323802c5b893f1683c702af30a82598b4ecd80b (HEAD -> master)
Author: Ashish Kumar <kr.ashish@samsung.com>
Date:   Tue Oct 3 13:57:24 2017 +0530

    avprotocol: fix leak in error code paths
    
    https://bugzilla.gnome.org/show_bug.cgi?id=788481