GNOME Bugzilla – Bug 681459
rtmpsink: memory leak
Last modified: 2012-10-12 22:17:08 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
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!