From 7db1335adf1a0bf50ca6055fc86be528423c1844 Mon Sep 17 00:00:00 2001 From: suter Date: Fri, 30 May 2014 23:56:02 +0200 Subject: [PATCH] change the dict in which parsed properties are stored from homogeneous to heterogeneous. A leak occured in teshsuite/msg/storage/storage_basic.c after the addition of a call MSG_storage_set_property_value that adds a new property to the dict. The new element doesn't appear to be freed when freeing the resources. After several tries, the proposed modification solves the issue without breaking something else. --- src/surf/surfxml_parse.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/surf/surfxml_parse.c b/src/surf/surfxml_parse.c index dafaab16b9..ab38ab28ff 100644 --- a/src/surf/surfxml_parse.c +++ b/src/surf/surfxml_parse.c @@ -420,8 +420,8 @@ void STag_surfxml_prop(void) } else{ if (!current_property_set) - current_property_set = xbt_dict_new_homogeneous(xbt_free_f); // Maybe, it should raise an error - xbt_dict_set(current_property_set, A_surfxml_prop_id, xbt_strdup(A_surfxml_prop_value), NULL); + current_property_set = xbt_dict_new(); // Maybe, it should raise an error + xbt_dict_set(current_property_set, A_surfxml_prop_id, xbt_strdup(A_surfxml_prop_value), xbt_free); } } -- 2.20.1