From b79bccba80129154121307a7754f69911bca2163 Mon Sep 17 00:00:00 2001 From: Andrey Myznikov Date: Tue, 14 Jan 2014 01:42:42 +0100 Subject: [PATCH] avformat/librtmp: Fix memory leak if RTMP_ConnectStream() fails Signed-off-by: Michael Niedermayer --- libavformat/librtmp.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavformat/librtmp.c b/libavformat/librtmp.c index 5b4c39dde5..f0b5929e6a 100644 --- a/libavformat/librtmp.c +++ b/libavformat/librtmp.c @@ -134,6 +134,9 @@ static int rtmp_open(URLContext *s, const char *uri, int flags) fail: if (filename != s->filename) av_freep(&filename); + if (rc) + RTMP_Close(r); + return rc; }