avformat/librtmp: Fix memory leak if RTMP_ConnectStream() fails
authorAndrey Myznikov <andrey.myznikov@gmail.com>
Tue, 14 Jan 2014 00:42:42 +0000 (01:42 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 14 Jan 2014 00:59:23 +0000 (01:59 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/librtmp.c

index 5b4c39d..f0b5929 100644 (file)
@@ -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;
 }