[Live-devel] memory leak in RTSPClient::handleRequestError()

Ross Finlayson finlayson at live555.com
Thu Feb 28 10:03:04 PST 2013


> I'm developing a RTSP client application. While testing I've found a possible memory leak in RTSPClient::handleRequestError(). While calling the handler there is a string duplication of the error string.

No, there's no memory leak here.  In *all* calls to a RTSP "responseHandler" (including the one called to implement "handleRequestError()"), the "resultString" parameter is assumed to have been dynamically allocated, and must be delete[]d after the handler function has been called.  (See the comment in "liveMedia/include/RTSPClient.hh", lines 59-60.)

However, your question did turn out to be useful, because after I read it, I went through the code, looking for places where we might not be delete[]ing the "resultString" afterwards.  I did find a handful of places - in the "testRTSPClient" and "openRTSP" applications - where the "resultString" was not being delete[]d; thus, there was a minor memory leak in those places (although only in situations where a RTSP request failed).  These will be fixed in the next release of the software.


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/20130301/c8d78855/attachment.html>


More information about the live-devel mailing list