X-Git-Url: https://jfr.im/git/solanum.git/blobdiff_plain/66e1914beb3c8290b6537ec9aaa5c80be63f75e0..1ccc642277721bfb8b7108c2c05edf7c921acbfb:/ircd/operhash.c diff --git a/ircd/operhash.c b/ircd/operhash.c index a8348cb2..a19ce45e 100644 --- a/ircd/operhash.c +++ b/ircd/operhash.c @@ -1,9 +1,9 @@ -/* charybdis +/* solanum * operhash.c - Hashes nick!user@host{oper} * * Copyright (C) 2005 Lee Hardy * Copyright (C) 2005-2016 ircd-ratbox development team - * Copyright (C) 2016 William Pitcock + * Copyright (C) 2016 Ariadne Conill * * 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); + } }