From fbcb6a25493e74b050543afc60377a7985f80ea6 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Tue, 19 Jul 2016 15:59:35 -0700 Subject: [PATCH] ircd: Fix missing operhash reference decrement from b02a913b. --- ircd/operhash.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ircd/operhash.c b/ircd/operhash.c index a8348cb20..6d1948e6e 100644 --- a/ircd/operhash.c +++ b/ircd/operhash.c @@ -85,6 +85,13 @@ operhash_delete(const char *name) { struct operhash_entry *ohash = rb_radixtree_retrieve(operhash_tree, name); - if (ohash != NULL) + if(ohash == NULL) + return; + + ohash->refcount--; + if(ohash->refcount == 0) + { + rb_radixtree_delete(operhash_tree, ohash->name); rb_free(ohash); + } }