factory: plug pad leak in collect_streams
authorDavid Svensson Fors <davidsf@axis.com>
Tue, 12 Jun 2012 11:36:57 +0000 (13:36 +0200)
committerWim Taymans <wim.taymans@collabora.co.uk>
Thu, 14 Jun 2012 08:14:06 +0000 (10:14 +0200)
In gst_rtsp_media_factory_collect_streams: unref the srcpad that
was retrieved using gst_element_get_static_pad. gst_ghost_pad_new
will take one reference, and the other reference will otherwise
give a memory leak.

gst/rtsp-server/rtsp-media-factory.c

index e7b60f7..8db3357 100644 (file)
@@ -750,6 +750,7 @@ gst_rtsp_media_factory_collect_streams (GstRTSPMediaFactory * factory,
 
       /* ghost the pad of the payloader to the element */
       stream->srcpad = gst_ghost_pad_new (name, pad);
+      g_object_unref (pad);
       gst_pad_set_active (stream->srcpad, TRUE);
       gst_element_add_pad (media->element, stream->srcpad);
       gst_object_unref (elem);