]> jfr.im git - solanum.git/blobdiff - ircd/operhash.c
doc/reference.conf: document the auth::umodes configuration option
[solanum.git] / ircd / operhash.c
index a8348cb200adb83c26967aa21338b90de5fa9763..a19ce45eddc2420ca801f319a7fc7327712db214 100644 (file)
@@ -1,9 +1,9 @@
-/* charybdis
+/* solanum
  * operhash.c - Hashes nick!user@host{oper}
  *
  * Copyright (C) 2005 Lee Hardy <lee -at- leeh.co.uk>
  * Copyright (C) 2005-2016 ircd-ratbox development team
- * Copyright (C) 2016 William Pitcock <nenolod@dereferenced.org>
+ * Copyright (C) 2016 Ariadne Conill <ariadne@dereferenced.org>
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
@@ -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);
+       }
 }