[Live-devel] Coverity detected a memory leak in RTSPClient::setupMediaSubsession

Mathew Hounsell mathew.hounsell at avegasystems.com
Wed May 2 21:37:22 PDT 2007


"sessionStr", "setupStr", "authenticatorStr" are not deleted when the function 
returns ar 1018 because of break at 902

900  		if (rtpNumber == 0) {
901  		  envir().setResultMsg("Client port number unknown\n");
902  		  break;
903  		}

1017 	  delete[] cmd;
1018      return False;
1019 	} // End of Function

While looking at the fix for this I thought it simpler to functionally 
decompose the setup string creation, and go with the old style single return 
point. This does not address the std::bad_alloc exception case.

My patch is attached; svn diff format.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: liveMedia-RTSPClient-memory-leak.diff
Type: text/x-patch
Size: 8315 bytes
Desc: not available
Url : http://lists.live555.com/pipermail/live-devel/attachments/20070502/c58c2a7a/attachment.bin 


More information about the live-devel mailing list