diff --git a/gst/avi/gstavimux.c b/gst/avi/gstavimux.c index f0719472f5..225e824cc5 100644 --- a/gst/avi/gstavimux.c +++ b/gst/avi/gstavimux.c @@ -997,8 +997,6 @@ gst_avi_mux_request_new_pad (GstElement * element, newpad = gst_pad_new_from_template (templ, pad_name); - g_free (name); - avipad->collect = gst_collect_pads_add_pad (avimux->collect, newpad, sizeof (GstAviCollectData), NULL, TRUE); ((GstAviCollectData *) (avipad->collect))->avipad = avipad; @@ -1006,6 +1004,8 @@ gst_avi_mux_request_new_pad (GstElement * element, if (!gst_element_add_pad (element, newpad)) goto pad_add_failed; + g_free (name); + GST_DEBUG_OBJECT (newpad, "Added new request pad"); return newpad; @@ -1034,6 +1034,7 @@ too_many_video_pads: pad_add_failed: { GST_WARNING_OBJECT (avimux, "Adding the new pad '%s' failed", pad_name); + g_free (name); gst_object_unref (newpad); return NULL; }