diff options
Diffstat (limited to 'libctf/ctf-hash.c')
-rw-r--r-- | libctf/ctf-hash.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libctf/ctf-hash.c b/libctf/ctf-hash.c index 4696fcb..1c37d75 100644 --- a/libctf/ctf-hash.c +++ b/libctf/ctf-hash.c @@ -171,15 +171,15 @@ ctf_hashtab_insert (struct htab *htab, void *key, void *value, *slot = malloc (sizeof (ctf_helem_t)); if (!*slot) return NULL; + (*slot)->key = key; } else { if (key_free) - key_free ((*slot)->key); + key_free (key); if (value_free) value_free ((*slot)->value); } - (*slot)->key = key; (*slot)->value = value; return *slot; } |