summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Potter <agpotter@gmail.com>2014-08-10 15:06:46 -0700
committerSébastien Helleu <flashcode@flashtux.org>2014-08-11 22:51:20 +0200
commit62d891aea9c2ea105a21be7834dbbb96b7680083 (patch)
tree3d839632b15c2f59a15af23b7a1c195157970576 /src
parent4faa227a2d180762cf93c70a3e8bf3721baf3456 (diff)
downloadweechat-62d891aea9c2ea105a21be7834dbbb96b7680083.zip
core: callback_free_key shouldn't point to already free'd value
Diffstat (limited to 'src')
-rw-r--r--src/core/wee-hashtable.c3
-rw-r--r--src/core/wee-hashtable.h2
-rw-r--r--src/core/wee-string.c4
3 files changed, 3 insertions, 6 deletions
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);
}