]> jfr.im git - solanum.git/blobdiff - ircd/operhash.c
Resolve shfit/reduce conflict in timespec production (#54)
[solanum.git] / ircd / operhash.c
index a8348cb200adb83c26967aa21338b90de5fa9763..d1df22521203e356629ffbb5202deabc30ca7b52 100644 (file)
@@ -1,4 +1,4 @@
-/* charybdis
+/* solanum
  * operhash.c - Hashes nick!user@host{oper}
  *
  * Copyright (C) 2005 Lee Hardy <lee -at- leeh.co.uk>
@@ -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);
+       }
 }