[Live-devel] Leaking ReorderingBuffer packets in MultiFramedRTPSource.cpp on doStopGettingFrames [patch provided]
Kirill Zhegulev
kzhegulev at icontrol.com
Wed Apr 22 11:33:31 PDT 2015
Hi.
- MultiFramedRTPSource::networkReadHandler1() gets freePacket when it is called. (now fSavedPacketFree==False)
- usually it will call fReorderingBuffer->freePacket(bPacket); either directly or indirectly at the end,
- however if packetReadWasIncomplete function exits earlier. At this point fPacketReadInProgress holds the allocated packet, and fSavedPacketFree==False
- if close() is called at this point MultiFramedRTPSource::doStopGettingFrames() will call ReorderingPacketBuffer::reset(), but since fSavedPacketFree==False, delete fSavedPacket won’t happen.
Suggested patch:
@@ -105,6 +105,10 @@
}
void MultiFramedRTPSource::doStopGettingFrames() {
+ if (fPacketReadInProgress != NULL) {
+ fReorderingBuffer->freePacket(fPacketReadInProgress);
+ fPacketReadInProgress = NULL;
+ }
envir().taskScheduler().unscheduleDelayedTask(nextTask());
fRTPInterface.stopNetworkReading();
fReorderingBuffer->reset();
More information about the live-devel
mailing list