pulsesink: do not leak clientname when setting up property
authorMark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>
Fri, 11 Nov 2011 13:55:48 +0000 (14:55 +0100)
committerMark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>
Fri, 11 Nov 2011 13:59:04 +0000 (14:59 +0100)
ext/pulse/pulsesink.c

index ca769787c500595f8ccc216e6700de2fb3c49734..14c70e32b08cae0ec8f9baee3031239554ca4ef8 100644 (file)
@@ -1867,6 +1867,7 @@ gst_pulsesink_class_init (GstPulseSinkClass * klass)
   GstBaseSinkClass *bc;
   GstBaseAudioSinkClass *gstaudiosink_class = GST_BASE_AUDIO_SINK_CLASS (klass);
   GstElementClass *gstelement_class = GST_ELEMENT_CLASS (klass);
+  gchar *clientname;
 
   gobject_class->finalize = gst_pulsesink_finalize;
   gobject_class->set_property = gst_pulsesink_set_property;
@@ -1921,12 +1922,14 @@ gst_pulsesink_class_init (GstPulseSinkClass * klass)
    *
    * Since: 0.10.25
    */
+  clientname = gst_pulse_client_name ();
   g_object_class_install_property (gobject_class,
       PROP_CLIENT,
       g_param_spec_string ("client", "Client",
-          "The PulseAudio client name to use", gst_pulse_client_name (),
+          "The PulseAudio client name to use", clientname,
           G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS |
           GST_PARAM_MUTABLE_READY));
+  g_free (clientname);
 
   /**
    * GstPulseSink:stream-properties