From c44acd8bde9c256f2fa0312485605374cdb1b8af Mon Sep 17 00:00:00 2001 From: Jose Antonio Santos Cadenas Date: Wed, 13 May 2015 17:19:25 +0200 Subject: [PATCH] dtlsconnection: Fix memory leak while setting closure https://bugzilla.gnome.org/show_bug.cgi?id=749325 --- ext/dtls/gstdtlsconnection.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ext/dtls/gstdtlsconnection.c b/ext/dtls/gstdtlsconnection.c index 0d6d8270f4..3369a1462e 100644 --- a/ext/dtls/gstdtlsconnection.c +++ b/ext/dtls/gstdtlsconnection.c @@ -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)) { -- 2.34.1