[FFmpeg-devel] [PATCH v1 08/11] avformat/rtmpproto: fix memleak when open rtmp failed

Steven Liu lq at chinaffmpeg.org
Wed Oct 9 10:35:27 EEST 2019


Signed-off-by: Steven Liu <lq at chinaffmpeg.org>
---
 libavformat/rtmpproto.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c
index eb08d4d424..ae5eef8bca 100644
--- a/libavformat/rtmpproto.c
+++ b/libavformat/rtmpproto.c
@@ -2880,6 +2880,12 @@ reconnect:
     return 0;
 
 fail:
+    if (rt->playpath)
+        av_free(rt->playpath);
+    if (rt->tcurl)
+        av_free(rt->tcurl);
+    if (rt->flashver)
+        av_free(rt->flashver);
     av_dict_free(opts);
     rtmp_close(s);
     return ret;
-- 
2.15.1





More information about the ffmpeg-devel mailing list