From c4974f9a510a630e94d1e70b7564d42ff94a0334 Mon Sep 17 00:00:00 2001 From: =?utf8?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=utf8 Content-Transfer-Encoding: 8bit Patch by: José Roberto de Souza SVN revision: 79381 --- src/lib/edbus_proxy.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/lib/edbus_proxy.c b/src/lib/edbus_proxy.c index 2586b99..66c87d0 100644 --- a/src/lib/edbus_proxy.c +++ b/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) - { - eina_value_flush(value); - eina_value_copy(&stack_value, value); - } - else + if (!value) { - 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); -- 2.7.4