mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-22 23:28:16 +00:00
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
This commit is contained in:
parent
c88e042458
commit
8abfd9d720
1 changed files with 3 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue