diff options
author | Petr Machata <pmachata@redhat.com> | 2012-10-26 23:10:21 +0200 |
---|---|---|
committer | Petr Machata <pmachata@redhat.com> | 2012-10-26 23:10:21 +0200 |
commit | d3202de1176057520f49b5e6231b8774f6b6b31f (patch) | |
tree | 4ea64bb6e68898ed3644ef071d7ce03baddacc1e /dict.c | |
parent | 3cc0cd11ff97fd013813ae020aaf24dbdc818e43 (diff) | |
download | ltrace-d3202de1176057520f49b5e6231b8774f6b6b31f.tar.gz |
dict_remove should release memory allocated for the entry
Diffstat (limited to 'dict.c')
-rw-r--r-- | dict.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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; |