mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-07 07:58:51 +00:00
matroskamux: 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 : 1265774
This commit is contained in:
parent
8abfd9d720
commit
932b32bb6e
1 changed files with 3 additions and 1 deletions
|
@ -2274,7 +2274,6 @@ gst_matroska_mux_request_new_pad (GstElement * element,
|
||||||
|
|
||||||
newpad = g_object_new (GST_TYPE_MATROSKAMUX_PAD,
|
newpad = g_object_new (GST_TYPE_MATROSKAMUX_PAD,
|
||||||
"name", pad_name, "direction", templ->direction, "template", templ, NULL);
|
"name", pad_name, "direction", templ->direction, "template", templ, NULL);
|
||||||
g_free (name);
|
|
||||||
|
|
||||||
gst_matroskamux_pad_init (newpad);
|
gst_matroskamux_pad_init (newpad);
|
||||||
collect_pad = (GstMatroskaPad *)
|
collect_pad = (GstMatroskaPad *)
|
||||||
|
@ -2291,6 +2290,8 @@ gst_matroska_mux_request_new_pad (GstElement * element,
|
||||||
if (!gst_element_add_pad (element, GST_PAD (newpad)))
|
if (!gst_element_add_pad (element, GST_PAD (newpad)))
|
||||||
goto pad_add_failed;
|
goto pad_add_failed;
|
||||||
|
|
||||||
|
g_free (name);
|
||||||
|
|
||||||
mux->num_streams++;
|
mux->num_streams++;
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (newpad, "Added new request pad");
|
GST_DEBUG_OBJECT (newpad, "Added new request pad");
|
||||||
|
@ -2301,6 +2302,7 @@ gst_matroska_mux_request_new_pad (GstElement * element,
|
||||||
pad_add_failed:
|
pad_add_failed:
|
||||||
{
|
{
|
||||||
GST_WARNING_OBJECT (mux, "Adding the new pad '%s' failed", pad_name);
|
GST_WARNING_OBJECT (mux, "Adding the new pad '%s' failed", pad_name);
|
||||||
|
g_free (name);
|
||||||
gst_object_unref (newpad);
|
gst_object_unref (newpad);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue