diff options
author | Edward Hervey <edward@collabora.com> | 2014-05-13 11:41:42 +0200 |
---|---|---|
committer | Edward Hervey <edward@collabora.com> | 2014-05-13 11:41:42 +0200 |
commit | b2e037b7de5a571c0aa1c4a287c5080051521889 (patch) | |
tree | 5145f9ab8afa5412872b4e71c9e176b95d77de0a /sys/shm | |
parent | 93ef3f9b24b7f5d779592c523cec97fa1829a031 (diff) | |
download | gstreamer-plugins-bad-b2e037b7de5a571c0aa1c4a287c5080051521889.tar.gz |
shm: Don't leak GstShmPipe
By reordering the leaking code path to before the allocation
CID #1212153
Diffstat (limited to 'sys/shm')
-rw-r--r-- | sys/shm/gstshmsrc.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/shm/gstshmsrc.c b/sys/shm/gstshmsrc.c index d8ee560b4..8af1f34d1 100644 --- a/sys/shm/gstshmsrc.c +++ b/sys/shm/gstshmsrc.c @@ -214,10 +214,7 @@ gst_shm_src_get_property (GObject * object, guint prop_id, static gboolean gst_shm_src_start_reading (GstShmSrc * self) { - GstShmPipe *gstpipe = g_slice_new0 (GstShmPipe); - - gstpipe->use_count = 1; - gstpipe->src = gst_object_ref (self); + GstShmPipe *gstpipe; if (!self->socket_path) { GST_ELEMENT_ERROR (self, RESOURCE, NOT_FOUND, @@ -225,6 +222,10 @@ gst_shm_src_start_reading (GstShmSrc * self) return FALSE; } + gstpipe = g_slice_new0 (GstShmPipe); + gstpipe->use_count = 1; + gstpipe->src = gst_object_ref (self); + GST_DEBUG_OBJECT (self, "Opening socket %s", self->socket_path); GST_OBJECT_LOCK (self); |