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 681459 - rtmpsink: memory leak
rtmpsink: memory leak
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal normal
: 1.0.2
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-08-08 15:43 UTC by David Régade
Modified: 2012-10-12 22:17 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patvh against RTMP_ParseURL memoryleak (950 bytes, patch)
2012-08-08 15:43 UTC, David Régade
committed Details | Review

Description David Régade 2012-08-08 15:43:39 UTC
Created attachment 220696 [details] [review]
patvh against RTMP_ParseURL memoryleak

Hi,

In gst_rtmp_sink_uri_set_uri, a test is performed in order to be sure uri is correct for librtmp. This test calls RTMP_ParseURL with 3 AVal pointers as parameters: host, playpath and app.

AVal is a struct with a char* + int. After RTMP_ParseURL call, host.av_val and app.av_val both refer a substring of "uri". But playpath.av_val may be the result of a malloc so it needs to be freed.

I attached a patch.

Regards
Comment 1 Tim-Philipp Müller 2012-10-12 22:16:36 UTC
Thanks for the patch, pushed with minor changes: using 'ret' for the return value variable name (more in line with code elsewhere) and free() the AVal string, rather than g_free() it, since it was allocated with malloc not g_malloc().

 commit 65add5533aecfb30c866bd0412189b63a7a7e096
 Author: David Régade <dregade@viewsurf.com>
 Date:   Fri Oct 12 23:09:06 2012 +0100

    rtmpsink: fix memory leak from URI verification via RTMP_ParseURL()
    
    In gst_rtmp_sink_uri_set_uri(), a test is performed in order
    to be sure uri is correct for librtmp. This test calls
    RTMP_ParseURL with 3 AVal pointers as parameters: host,
    playpath and app.
    
    AVal is a struct with a char* + int. After RTMP_ParseURL call,
    host.av_val and app.av_val both refer a substring of "uri". But
    playpath.av_val may be the result of a malloc so it needs to
    be freed.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=681459


A patch in git format-patch would be great next time!