Repository: lucy-clownfish Updated Branches: refs/heads/master 904bfa999 -> 13688813c
Memory leak in LFReg_register Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/13688813 Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/13688813 Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/13688813 Branch: refs/heads/master Commit: 13688813cf15968354a2e04ad6d2e3e8f415b182 Parents: 41ec26e Author: Nick Wellnhofer <[email protected]> Authored: Sun May 10 04:14:11 2015 +0200 Committer: Nick Wellnhofer <[email protected]> Committed: Tue May 12 20:05:12 2015 +0200 ---------------------------------------------------------------------- runtime/core/Clownfish/LockFreeRegistry.c | 5 +++++ 1 file changed, 5 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/13688813/runtime/core/Clownfish/LockFreeRegistry.c ---------------------------------------------------------------------- diff --git a/runtime/core/Clownfish/LockFreeRegistry.c b/runtime/core/Clownfish/LockFreeRegistry.c index 377b819..5c6315f 100644 --- a/runtime/core/Clownfish/LockFreeRegistry.c +++ b/runtime/core/Clownfish/LockFreeRegistry.c @@ -60,6 +60,11 @@ FIND_END_OF_LINKED_LIST: LFRegEntry *entry = *slot; if (entry->hash_sum == hash_sum) { if (Str_Equals(key, (Obj*)entry->key)) { + if (new_entry) { + DECREF(new_entry->key); + DECREF(new_entry->value); + FREEMEM(new_entry); + } return false; } }
