v4l2radio: Free videodev string before replacing it
authorSebastian Dröge <sebastian.droege@collabora.co.uk>
Thu, 14 Apr 2011 11:37:52 +0000 (13:37 +0200)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Thu, 14 Apr 2011 11:38:30 +0000 (13:38 +0200)
sys/v4l2/gstv4l2radio.c

index b1699d3..63a2fed 100644 (file)
@@ -384,6 +384,7 @@ gst_v4l2radio_init (GstV4l2Radio * filter, GstV4l2RadioClass * gclass)
       gst_v4l2radio_get_input, gst_v4l2radio_set_input, NULL);
 
   filter->v4l2object->frequency = DEFAULT_FREQUENCY;
+  g_free (filter->v4l2object->videodev);
   filter->v4l2object->videodev = g_strdup (DEFAULT_PROP_DEVICE);
 }
 
@@ -521,6 +522,7 @@ gst_v4l2radio_set_property (GObject * object, guint prop_id,
   gint frequency;
   switch (prop_id) {
     case ARG_DEVICE:
+      g_free (radio->v4l2object->videodev);
       radio->v4l2object->videodev =
           g_strdup ((gchar *) g_value_get_string (value));
       break;