summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavel Vasin <rat4vier@gmail.com>2012-06-13 15:56:49 +0400
committerRay Strode <rstrode@redhat.com>2012-06-13 07:07:25 -0400
commit279a6e0dfaffd6d8aa8363682d599ef68b485fbe (patch)
treec922eeace5d02aca885eade7dde3a0449301ff96
parent271162a08b4ff26f852052e358c9d9bb60f5e994 (diff)
lib: fix memory leaks in act-user
caller must free all of the values returned by g_variant_iter_next() https://bugs.freedesktop.org/show_bug.cgi?id=51039
-rw-r--r--src/libaccountsservice/act-user.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libaccountsservice/act-user.c b/src/libaccountsservice/act-user.c
index 02c1070..f42d00d 100644
--- a/src/libaccountsservice/act-user.c
+++ b/src/libaccountsservice/act-user.c
@@ -1063,7 +1063,7 @@ on_get_all_finished (GObject *object,
GError *error;
GVariant *res;
GVariantIter *iter;
- const gchar *key;
+ gchar *key;
GVariant *value;
g_assert (G_IS_DBUS_PROXY (user->object_proxy));
@@ -1089,6 +1089,8 @@ on_get_all_finished (GObject *object,
g_variant_get (res, "(a{sv})", &iter);
while (g_variant_iter_next (iter, "{sv}", &key, &value)) {
collect_props (key, value, user);
+ g_free (key);
+ g_variant_unref (value);
}
g_variant_iter_free (iter);
g_variant_unref (res);