[Live-devel] MediaSink / Memory leak

Ross Finlayson finlayson at live555.com
Tue Mar 6 14:16:35 PST 2012


> This particular code snippet was taken directly from the Live555 H264VideoFileSink class implementation of its afterGettingFrame() method, so the exact code and usage context should be identical. 
> 
> Anyway, I have taken my app run it on Xcode, and this line pretty quickly crashes the app: 
> 
>     delete[] sPropRecords;
> 
> with the error that the "pointer being freed was not allocated".

I don't understand why you're getting an error here; the code looks OK.


> I then figured that there was something internal to the parseSPropParameterSets which might conditionally allocate sPropRecords. So I wrapped the delete in a conditional: 
> 
>     if (sPropRecords)
>     {
>         delete[] sPropRecords;
>     }
> 
> The error was the same

FYI, in C++ "delete[]"ing (or "delete"ing) a NULL pointer is not an error (it has no effect).

Ross Finlayson
Live Networks, Inc.
http://www.live555.com/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20120306/8a9d600a/attachment.html>


More information about the live-devel mailing list