Commit 8abfd9d7 authored by Edward Hervey's avatar Edward Hervey

avimux: Avoid using freed variable

the name variable might have been attributed to pad_name, make sure we
free it only *after* pad_name has been used.

Coverity CID : 1265775
parent c88e0424
......@@ -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:
GST_WARNING_OBJECT (avimux, "Adding the new pad '%s' failed", pad_name);
g_free (name);
gst_object_unref (newpad);
return NULL;
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment