X-Git-Url: https://jfr.im/git/solanum.git/blobdiff_plain/2fc6772ee1428ba75e1e1e49a1b935a20ece50d4..8efff56fdf9f4ce4a3968c74162fed9d8d45c51a:/ircd/operhash.c diff --git a/ircd/operhash.c b/ircd/operhash.c index a8348cb2..d1df2252 100644 --- a/ircd/operhash.c +++ b/ircd/operhash.c @@ -1,4 +1,4 @@ -/* charybdis +/* solanum * operhash.c - Hashes nick!user@host{oper} * * Copyright (C) 2005 Lee Hardy @@ -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); + } }