From: Martin Storsjo Date: Thu, 5 Dec 2013 09:06:49 +0000 (+0200) Subject: Free the extra read buffer if the initial FLV buffer overflowed X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3cd3440f0eb018f32a1f0ada32fef077bf7821b4;p=rtmpdump Free the extra read buffer if the initial FLV buffer overflowed This fixes a leak in this cornercase. --- diff --git a/librtmp/rtmp.c b/librtmp/rtmp.c index 8c7b8d4..2693b65 100644 --- a/librtmp/rtmp.c +++ b/librtmp/rtmp.c @@ -5026,6 +5026,7 @@ fail: if (r->m_read.buf < mybuf || r->m_read.buf > end) { mybuf = realloc(mybuf, cnt + nRead); memcpy(mybuf+cnt, r->m_read.buf, nRead); + free(r->m_read.buf); r->m_read.buf = mybuf+cnt+nRead; break; }