v4l2object: Fix a gvalue leak on error

In case we failed enumerating the supported interlacing mode, we leaked the
gvalue.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7540>
This commit is contained in:
Nicolas Dufresne 2024-09-18 13:14:32 -04:00 committed by GStreamer Marge Bot
parent a6959f3738
commit 09e23e325c

View file

@ -2378,9 +2378,11 @@ gst_v4l2_object_add_interlace_mode (GstV4l2Object * v4l2object,
if (gst_v4l2src_value_simplify (&interlace_formats)
|| gst_value_list_get_size (&interlace_formats) > 0)
gst_structure_take_value (s, "interlace-mode", &interlace_formats);
else
else {
GST_WARNING_OBJECT (v4l2object->dbg_obj,
"Failed to determine interlace mode");
g_value_unset (&interlace_formats);
}
return;
}