From f257d0b2de4f88153b9a5404e4b02f2727fa7f86 Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Sat, 11 Aug 2018 01:42:30 -0700 Subject: [PATCH] Remove freed refcount from any list it's part of. --- src/refcount.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/refcount.c b/src/refcount.c index 97226c1..b02003b 100644 --- a/src/refcount.c +++ b/src/refcount.c @@ -29,6 +29,8 @@ void _libab_ref_changed(libab_ref* ref) { } } if (ref->count->weak == 0) { + if(ref->count->prev) ref->count->prev->next = ref->count->next; + if(ref->count->next) ref->count->next->prev = ref->count->prev; free(ref->count); } }