[telepathy-gabble/master] If the SelectedCandidate is being changed, free the old one so it doesn't leak.

Mike Ruprecht mike.ruprecht at collabora.co.uk
Tue Dec 29 05:35:07 PST 2009


---
 src/call-stream-endpoint.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/call-stream-endpoint.c b/src/call-stream-endpoint.c
index a1b7ad9..1fe2bb8 100644
--- a/src/call-stream-endpoint.c
+++ b/src/call-stream-endpoint.c
@@ -385,6 +385,10 @@ call_stream_endpoint_set_selected_candidate (
 {
   GabbleCallStreamEndpoint *self = GABBLE_CALL_STREAM_ENDPOINT (iface);
 
+  if (self->priv->selected_candidate != NULL)
+    g_boxed_free (GABBLE_STRUCT_TYPE_CANDIDATE,
+        self->priv->selected_candidate);
+
   self->priv->selected_candidate =
       g_boxed_copy (GABBLE_STRUCT_TYPE_CANDIDATE, candidate);
 
-- 
1.5.6.5




More information about the telepathy-commits mailing list