]> granicus.if.org Git - rtmpdump/commitdiff
Free the extra read buffer if the initial FLV buffer overflowed
authorMartin Storsjo <martin@martin.st>
Thu, 5 Dec 2013 09:06:49 +0000 (11:06 +0200)
committerMartin Storsjo <martin@martin.st>
Thu, 5 Dec 2013 09:06:49 +0000 (11:06 +0200)
This fixes a leak in this cornercase.

librtmp/rtmp.c

index 8c7b8d43151edc5e859ea0c9a6383c1019334615..2693b65013a210816a317e326af1a700adb632b0 100644 (file)
@@ -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;
              }