From 68728dda4be06b87a5e3cacf563bee63e33bf7ec Mon Sep 17 00:00:00 2001 From: Nicolas Dufresne Date: Wed, 18 Sep 2024 13:14:32 -0400 Subject: [PATCH] v4l2object: Fix a gvalue leak on error In case we failed enumerating the supported interlacing mode, we leaked the gvalue. Part-of: --- subprojects/gst-plugins-good/sys/v4l2/gstv4l2object.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/subprojects/gst-plugins-good/sys/v4l2/gstv4l2object.c b/subprojects/gst-plugins-good/sys/v4l2/gstv4l2object.c index 9b9db41652..472a24ef55 100644 --- a/subprojects/gst-plugins-good/sys/v4l2/gstv4l2object.c +++ b/subprojects/gst-plugins-good/sys/v4l2/gstv4l2object.c @@ -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; } -- 2.34.1