[Live-devel] memory leak? some questions

Ross Finlayson finlayson at live555.com
Sat Sep 1 07:10:25 PDT 2007


>1) why we have make sure the fRTPSink, fRTCPInstance, fRTPgs, 
>fRTCPgs is not NULL. After the SETUP, all of them must have been 
>allocated.

No, not necessarily.  If we are streaming via raw UDP (instead of via 
RTP/UDP), then "fRTPSink" and "fRTCPInstance" will be NULL (with 
"fUDPSink" being non-NULL).


>2) why not use fRTPSink and fRTCPInstance to instead of the fRTPgs 
>and fRTCPgs when call addDestination?

For the same reason.  If we're streaming via raw UDP, then "fRTPSink" 
and "fRTCPInstance" will be NULL, but "fRTPgs" (in this case somewhat 
misnamed, because it won't be used for RTP) will not be NULL.


>1) As more and more client has connected to the server, the 
>available port of the system may be very few. At that time, the 
>searching for a pair of available port will become a block 
>operation, which will affect to complete other requests effectively.

No, the allocation of sockets is a non-blocking operation.


>2) Consider the following scene:
>    the port, 6640, 6642 and 6643, are free ports. The rtpSocket will 
>be happy when she finds the 6640 is a free port, but the rtcpSocket 
>will be unhappy, because 6641 has been ocupied for some reason. Then 
>the loop continue, while the rtcpSocket is freed and rtpSocke is 
>still allocated, MEMORY LEAK!

Yes, you're correct.  The second "if" statement should contain
	delete rtpGroupsock;
in addition to
	delete rtcpGroupsock;

Thanks for reporting this; this will be fixed in the next release of 
the software.
-- 

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


More information about the live-devel mailing list