diff mbox

[FFmpeg-devel] rtmp: Plug leak if sending bytes read report fails.

Message ID 1516754956-23680-1-git-send-email-joshua.allmann@gmail.com
State Accepted
Commit a2a9e4eea0e4fde2ed8d3405b4f33f655b600c2d
Headers show

Commit Message

Josh Allmann Jan. 24, 2018, 12:49 a.m. UTC
---
 libavformat/rtmpproto.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Michael Niedermayer Jan. 25, 2018, 7:43 p.m. UTC | #1
On Tue, Jan 23, 2018 at 04:49:16PM -0800, Josh Allmann wrote:
> ---
>  libavformat/rtmpproto.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

applied

thx

[...]
diff mbox

Patch

diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c
index faf2a6f244..b741e421af 100644
--- a/libavformat/rtmpproto.c
+++ b/libavformat/rtmpproto.c
@@ -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;
         }