Commit b2e037b7 authored by Edward Hervey's avatar Edward Hervey

shm: Don't leak GstShmPipe

By reordering the leaking code path to before the allocation

CID #1212153
parent 93ef3f9b
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment