aboutsummaryrefslogtreecommitdiff
path: root/dict.c
diff options
context:
space:
mode:
authorPetr Machata <pmachata@redhat.com>2012-10-26 23:10:21 +0200
committerPetr Machata <pmachata@redhat.com>2012-10-26 23:10:21 +0200
commitd3202de1176057520f49b5e6231b8774f6b6b31f (patch)
tree4ea64bb6e68898ed3644ef071d7ce03baddacc1e /dict.c
parent3cc0cd11ff97fd013813ae020aaf24dbdc818e43 (diff)
downloadltrace-d3202de1176057520f49b5e6231b8774f6b6b31f.tar.gz
dict_remove should release memory allocated for the entry
Diffstat (limited to 'dict.c')
-rw-r--r--dict.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/dict.c b/dict.c
index fbcd733..aad50fd 100644
--- a/dict.c
+++ b/dict.c
@@ -142,7 +142,9 @@ dict_remove(Dict *d, void *key)
continue;
if (d->key_cmp(key, entry->key) == 0) {
*entryp = entry->next;
- return entry->value;
+ void *value = entry->value;
+ free(entry);
+ return value;
}
}
return NULL;