dtlsconnection: Fix memory leak while setting closure
authorJose Antonio Santos Cadenas <santoscadenas@gmail.com>
Wed, 13 May 2015 15:19:25 +0000 (17:19 +0200)
committerSebastian Dröge <sebastian@centricular.com>
Wed, 13 May 2015 16:10:34 +0000 (19:10 +0300)
https://bugzilla.gnome.org/show_bug.cgi?id=749325

ext/dtls/gstdtlsconnection.c

index 0d6d8270f4bab22395cbfc2b218ecff0929b558e..3369a1462ef21b667825950627eae699ffed529a 100644 (file)
@@ -454,6 +454,10 @@ gst_dtls_connection_set_send_callback (GstDtlsConnection * self,
   g_mutex_lock (&self->priv->mutex);
   GST_TRACE_OBJECT (self, "locked @ set_send_callback");
 
+  if (self->priv->send_closure) {
+    g_closure_unref (self->priv->send_closure);
+    self->priv->send_closure = NULL;
+  }
   self->priv->send_closure = closure;
 
   if (closure && G_CLOSURE_NEEDS_MARSHAL (closure)) {