From f02c23a593614e6cbf04bb4ae950f8405cb82973 Mon Sep 17 00:00:00 2001 From: Philipp Schafft Date: Mon, 28 May 2018 14:00:59 +0000 Subject: [PATCH] Fix: Corrected reference counters --- src/module.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/module.c b/src/module.c index 3dc524b7..8aa82820 100644 --- a/src/module.c +++ b/src/module.c @@ -63,6 +63,9 @@ int module_container_add_module(module_container_t *self, mo if (!self) return -1; + if (refobject_ref(module) != 0) + return -1; + thread_mutex_lock(&(self->lock)); avl_insert(self->module, module); thread_mutex_unlock(&(self->lock)); @@ -105,6 +108,7 @@ module_t * module_container_get_module(module_container_t *self, co } refobject_unref(search); + refobject_ref(ret); return ret; }