From d26d9a48b10f925118694879236a3f9ba7d9abbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Roberto=20de=20Souza?= Date: Fri, 16 Nov 2012 13:07:06 +0000 Subject: [PATCH] edbus: Fix leak in GetAll Properties of Proxy monitor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Patch by: José Roberto de Souza SVN revision: 79381 --- legacy/edbus/src/lib/edbus_proxy.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/legacy/edbus/src/lib/edbus_proxy.c b/legacy/edbus/src/lib/edbus_proxy.c index 2586b99907..66c87d0dd7 100644 --- a/legacy/edbus/src/lib/edbus_proxy.c +++ b/legacy/edbus/src/lib/edbus_proxy.c @@ -693,17 +693,13 @@ _property_iter(void *data, const void *key, EDBus_Message_Iter *var) eina_value_struct_value_get(st_value, "arg0", &stack_value); value = eina_hash_find(proxy->props, skey); - if (value) + if (!value) { - eina_value_flush(value); - eina_value_copy(&stack_value, value); - } - else - { - value = calloc(1, sizeof(Eina_Value)); - eina_value_copy(&stack_value, value); + value = eina_value_new(eina_value_type_get(&stack_value)); eina_hash_add(proxy->props, skey, value); } + eina_value_flush(value); + eina_value_copy(&stack_value, value); eina_value_free(st_value); eina_value_flush(&stack_value);