Merge pull request #1292 from pkviet/leaks

Fix several mem leaks
This commit is contained in:
Jim
2018-06-17 20:54:10 -07:00
committed by GitHub
5 changed files with 23 additions and 9 deletions

View File

@@ -4288,14 +4288,14 @@ RTMP_Close(RTMP *r)
r->m_customSendParam = NULL;
#if defined(CRYPTO) || defined(USE_ONLY_MD5)
for (int idx = 0; idx < r->Link.nStreams; idx++)
{
free(r->Link.streams[idx].playpath.av_val);
r->Link.streams[idx].playpath.av_val = NULL;
}
if (!(r->Link.protocol & RTMP_FEATURE_WRITE) || (r->Link.pFlags & RTMP_PUB_CLEAN))
{
for (int idx = 0; idx < r->Link.nStreams; idx++)
{
free(r->Link.streams[idx].playpath.av_val);
r->Link.streams[idx].playpath.av_val = NULL;
}
r->Link.curStreamIdx = 0;
r->Link.nStreams = 0;
}