summaryrefslogtreecommitdiff
path: root/libavformat/rtmpproto.c
diff options
context:
space:
mode:
authorAlexander Drozdov <adrozdoff@gmail.com>2014-10-18 16:02:32 +0200
committerLuca Barbato <lu_zero@gentoo.org>2014-10-18 17:37:11 +0200
commit0034314a69e76a53534a74cceef865cfcb7b42cc (patch)
tree20d4c92b37d7251611983553d6b67486073d4255 /libavformat/rtmpproto.c
parentfc1eda543c6ef043300612db90da5cfd972af650 (diff)
rtmp: Always call rtmp_close() on rtmp_open() failure
Prevent possible memory leaks. Connect to nginx and request a non-existent resource to trigger the issue. CC: libav-stable@libav.org Signed-off-by: Michael Niedermayer <michaelni@gmx.at> Signed-off-by: Uwe L. Korn <uwelk@xhochy.com> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Diffstat (limited to 'libavformat/rtmpproto.c')
-rw-r--r--libavformat/rtmpproto.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c
index 55987b76df..d0e97920f5 100644
--- a/libavformat/rtmpproto.c
+++ b/libavformat/rtmpproto.c
@@ -2817,11 +2817,10 @@ reconnect:
}
if (rt->is_input) {
- int err;
// generate FLV header for demuxer
rt->flv_size = 13;
- if ((err = av_reallocp(&rt->flv_data, rt->flv_size)) < 0)
- return err;
+ if ((ret = av_reallocp(&rt->flv_data, rt->flv_size)) < 0)
+ goto fail;
rt->flv_off = 0;
memcpy(rt->flv_data, "FLV\1\0\0\0\0\011\0\0\0\0", rt->flv_size);
@@ -2832,7 +2831,7 @@ reconnect:
// audio or video packet arrives.
while (!rt->has_audio && !rt->has_video && !rt->received_metadata) {
if ((ret = get_packet(s, 0)) < 0)
- return ret;
+ goto fail;
}
// Either after we have read the metadata or (if there is none) the