[network-manager-applet/nma-0-9-8] applet: fix small leak



commit b367d3bbbd539589f75f60d94fedd93ff4705e81
Author: Dan Winship <danw gnome org>
Date:   Fri Apr 19 09:22:20 2013 -0400

    applet: fix small leak
    
    When libsecret doesn't return the expected data, we still have to free
    the parts that it did return.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=697566

 src/applet-agent.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/src/applet-agent.c b/src/applet-agent.c
index 731dc7b..1a134f2 100644
--- a/src/applet-agent.c
+++ b/src/applet-agent.c
@@ -364,8 +364,11 @@ keyring_find_secrets_cb (GObject *source,
                if (secret) {
                        attributes = secret_item_get_attributes (item);
                        key_name = g_hash_table_lookup (attributes, KEYRING_SK_TAG);
-                       if (!key_name)
+                       if (!key_name) {
+                               g_hash_table_unref (attributes);
+                               secret_value_unref (secret);
                                continue;
+                       }
 
                        g_hash_table_insert (secrets, g_strdup (key_name),
                                             string_to_gvalue (secret_value_get (secret, NULL)));


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