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; }