From 62d891aea9c2ea105a21be7834dbbb96b7680083 Mon Sep 17 00:00:00 2001 From: Andrew Potter Date: Sun, 10 Aug 2014 15:06:46 -0700 Subject: core: callback_free_key shouldn't point to already free'd value --- src/core/wee-hashtable.c | 3 +-- src/core/wee-hashtable.h | 2 +- src/core/wee-string.c | 4 +--- 3 files changed, 3 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/core/wee-hashtable.c b/src/core/wee-hashtable.c index b18666fe9..1c4095f24 100644 --- a/src/core/wee-hashtable.c +++ b/src/core/wee-hashtable.c @@ -307,8 +307,7 @@ hashtable_free_key (struct t_hashtable *hashtable, if (hashtable->callback_free_key) { (void) (hashtable->callback_free_key) (hashtable, - item->key, - item->value); + item->key); } else { diff --git a/src/core/wee-hashtable.h b/src/core/wee-hashtable.h index 20f6ec05b..937867858 100644 --- a/src/core/wee-hashtable.h +++ b/src/core/wee-hashtable.h @@ -28,7 +28,7 @@ typedef unsigned long long (t_hashtable_hash_key)(struct t_hashtable *hashtable, typedef int (t_hashtable_keycmp)(struct t_hashtable *hashtable, const void *key1, const void *key2); typedef void (t_hashtable_free_key)(struct t_hashtable *hashtable, - void *key, const void *value); + void *key); typedef void (t_hashtable_free_value)(struct t_hashtable *hashtable, const void *key, void *value); typedef void (t_hashtable_map)(void *data, diff --git a/src/core/wee-string.c b/src/core/wee-string.c index 5cab4a35d..dc184b9ca 100644 --- a/src/core/wee-string.c +++ b/src/core/wee-string.c @@ -2815,12 +2815,10 @@ string_shared_keycmp (struct t_hashtable *hashtable, */ void -string_shared_free_key (struct t_hashtable *hashtable, - void *key, const void *value) +string_shared_free_key (struct t_hashtable *hashtable, void *key) { /* make C compiler happy */ (void) hashtable; - (void) value; free (key); } -- cgit v1.2.3