video: fix leak in gst_video_format_new_template_caps()
authorTim-Philipp Müller <tim.muller@collabora.co.uk>
Tue, 6 Dec 2011 14:55:38 +0000 (14:55 +0000)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Tue, 6 Dec 2011 14:55:54 +0000 (14:55 +0000)
g_value_reset() is not the same as g_value_unset()

gst-libs/gst/video/video.c

index af5091c..2ad97f2 100644 (file)
@@ -762,11 +762,9 @@ gst_video_format_new_template_caps (GstVideoFormat format)
     gst_value_list_append_value (&value, &v);
     g_value_set_boolean (&v, FALSE);
     gst_value_list_append_value (&value, &v);
+    g_value_unset (&v);
 
-    gst_structure_set_value (structure, "interlaced", &value);
-
-    g_value_reset (&value);
-    g_value_reset (&v);
+    gst_structure_take_value (structure, "interlaced", &value);
   }
 
   return caps;