From c5279cfaeb601cce952b7763571efd76a68150df Mon Sep 17 00:00:00 2001 From: sachiel Date: Thu, 29 Mar 2012 17:46:17 +0000 Subject: [PATCH] Hack to avoid freeing old data when calling eina_hash_set() with new_data == NULL. Let's have a minute of silence for all the innocent children that died because of this very grave error. git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@69763 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- ChangeLog | 4 ++++ src/lib/eina_hash.c | 3 +++ 2 files changed, 7 insertions(+) diff --git a/ChangeLog b/ChangeLog index 354500d..e6b59b7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -241,3 +241,7 @@ 2012-03-16 Raphael Kubo da Costa * Adjust Valgrind's CFLAGS to fix the build when it is in a non-default location. + +2012-03-29 Iván Briano + + * Avoid freeing old data before returning it on eina_hash_set(). diff --git a/src/lib/eina_hash.c b/src/lib/eina_hash.c index 5196894..afdc114 100644 --- a/src/lib/eina_hash.c +++ b/src/lib/eina_hash.c @@ -1136,7 +1136,10 @@ eina_hash_set(Eina_Hash *hash, const void *key, const void *data) } else { + Eina_Free_Cb cb = hash->data_free_cb; + hash->data_free_cb = NULL; _eina_hash_del_by_hash_el(hash, hash_element, hash_head, key_hash); + hash->data_free_cb = cb; } return old_data; -- 2.7.4