GNOME Bugzilla – Bug 543101
The udpsrc/udpsink/multiudpsink/dynudpsink elements may leak file descriptors
Last modified: 2008-08-20 11:51:39 UTC
If one has set the closefd property to TRUE (which it is by default) and specified a socket via the sockfd property for either of udpsrc, udpsink, multiudpsink or dynudpsink, the element will leak the file descriptor in case it is never set to the PAUSED state even though the closefd property indicates that the element is the owner of the file descriptor. It will also use a closed file descriptor in case it is set to PAUSED again after having gone from PAUSED to READY... The attached patch should fix these problems. I do not think it warrants a blocker for the pending -good release, so I intend to commit it once -good is thawed (and I am back from vacation). But if anyone feels like committing it before then, feel free. ;)
Created attachment 114597 [details] [review] Close socket owned by the udp element
Patch by: Peter Kjellerstedt <pkj at axis com> * gst/udp/gstdynudpsink.c: (gst_dynudpsink_init), (gst_dynudpsink_finalize), (gst_dynudpsink_set_property), (gst_dynudpsink_init_send), (gst_dynudpsink_close): * gst/udp/gstmultiudpsink.c: (gst_multiudpsink_init), (gst_multiudpsink_finalize), (gst_multiudpsink_set_property): * gst/udp/gstudpsrc.c: (gst_udpsrc_finalize), (gst_udpsrc_set_property): Avoid leaking internally allocated file descriptors when setting custom file descriptors. Fixes #543101.