GNOME Bugzilla – Bug 756968
rtsp-stream: GstBin leak in udp-mcast case
Last modified: 2015-10-23 13:44:24 UTC
Created attachment 313862 [details] [review] rtsp-stream: plug GstBin leak in udp-mcast case When setting a GstRTSPMedia to playing, GstRTSPStreamTransports are added to GstRTSPStreams. Then, the function update_transport() in rtsp-stream.c is called. We have found a leak here for udp-mcast transports. Part of a valgrind log: Running suite(s): rtp ==27802== 19,599 (776 direct, 18,823 indirect) bytes in 1 blocks are definitely lost in loss record 4,271 of 4,276 ==27802== at 0x7653B8C: g_type_create_instance (gtype.c:1847) ==27802== by 0x7637F30: g_object_new_internal (gobject.c:1724) ==27802== by 0x7639B9C: g_object_newv (gobject.c:1868) ==27802== by 0x7262B86: gst_element_factory_create (gstelementfactory.c:376) ==27802== by 0x72630A3: gst_element_factory_make (gstelementfactory.c:446) ==27802== by 0x7344852: priv_gst_parse_yyparse (grammar.y:688) ==27802== by 0x734891F: priv_gst_parse_launch (grammar.y:1050) ==27802== by 0x7334E02: gst_parse_launch_full (gstparse.c:325) ==27802== by 0x7334C79: gst_parse_launch (gstparse.c:290) ==27802== by 0x6C528FC: default_create_element (rtsp-media-factory.c:1176) ==27802== by 0x6C5324A: gst_rtsp_media_factory_create_element (rtsp-media-factory.c:1344) ... 100%: Checks: 3, Failures: 0, Errors: 0 Makefile:3762: recipe for target 'rtp/rtp.valgrind' failed make: *** [rtp/rtp.valgrind] Error 1 It is a GstBin that leaks in update_transport(). The attached patch contains a fix for this.
Bug #756969 contains a patch with a new unit test that exposes this problem when run in valgrind.
Comment on attachment 313862 [details] [review] rtsp-stream: plug GstBin leak in udp-mcast case commit 81ae320383894892b4b4b53482a04c998441430d Author: David Svensson Fors <davidsf@axis.com> Date: Thu Oct 22 09:15:21 2015 +0200 rtsp-stream: Always unref return value of gst_object_get_parent() Fixes a leak of a GstBin in the udp-mcast case. https://bugzilla.gnome.org/show_bug.cgi?id=756968