[gnome-maps] maps-contact-store: Fix memory leaks



commit 583128ba5e19ef8a3a3660d83aa7b5cf71d810f8
Author: Jonas Danielsson <jonas threetimestwo org>
Date:   Sun Aug 23 16:02:17 2015 +0200

    maps-contact-store: Fix memory leaks

 lib/maps-contact-store.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/lib/maps-contact-store.c b/lib/maps-contact-store.c
index 8abcb47..036d8bc 100644
--- a/lib/maps-contact-store.c
+++ b/lib/maps-contact-store.c
@@ -119,7 +119,10 @@ get_contact (FolksIndividual *individual)
 
   iter = gee_iterable_iterator (GEE_ITERABLE (addresses));
   if (!gee_iterator_has_next (iter))
-    return NULL;
+    {
+      g_object_unref (iter);
+      return NULL;
+    }
 
   contact = maps_contact_new ();
 
@@ -186,6 +189,7 @@ get_contact (FolksIndividual *individual)
 
       maps_contact_add_place (contact, place);
     }
+  g_object_unref (iter);
 
   return contact;
 }
@@ -253,6 +257,7 @@ aggregator_quiescent_notify (FolksIndividualAggregator *aggregator,
       if (contact)
         store->priv->list = g_list_prepend (store->priv->list, contact);
     }
+  g_clear_object (&iter);
 
   store->priv->state = MAPS_CONTACT_STORE_STATE_LOADED;
   g_object_notify (G_OBJECT (store), "state");


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]