]> git.sesse.net Git - ffmpeg/commitdiff
libavformat/rtmpproto: Plug leak if sending bytes read report fails.
authorJosh Allmann <joshua.allmann@gmail.com>
Wed, 24 Jan 2018 00:49:16 +0000 (16:49 -0800)
committerMichael Niedermayer <michael@niedermayer.cc>
Thu, 25 Jan 2018 19:42:39 +0000 (20:42 +0100)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/rtmpproto.c

index faf2a6f24409c3cbc574fd900b6e337d809b0393..b741e421af972a66bf424c730f3992549962eb05 100644 (file)
@@ -2431,8 +2431,10 @@ static int get_packet(URLContext *s, int for_header)
         rt->bytes_read += ret;
         if (rt->bytes_read - rt->last_bytes_read > rt->receive_report_size) {
             av_log(s, AV_LOG_DEBUG, "Sending bytes read report\n");
-            if ((ret = gen_bytes_read(s, rt, rpkt.timestamp + 1)) < 0)
+            if ((ret = gen_bytes_read(s, rt, rpkt.timestamp + 1)) < 0) {
+                ff_rtmp_packet_destroy(&rpkt);
                 return ret;
+            }
             rt->last_bytes_read = rt->bytes_read;
         }