-/* 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
{
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);
+ }
}