From 1e221ac32ee2a0dcb86940b3236fc790c0af2e4f Mon Sep 17 00:00:00 2001 From: Ed Kellett Date: Tue, 2 Jun 2020 16:08:40 +0100 Subject: [PATCH] capability: accept new ownerdata for existing caps --- ircd/capability.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ircd/capability.c b/ircd/capability.c index f82821d9..e82143e5 100644 --- a/ircd/capability.c +++ b/ircd/capability.c @@ -67,6 +67,11 @@ capability_put(struct CapabilityIndex *idx, const char *cap, void *ownerdata) if ((entry = rb_dictionary_retrieve(idx->cap_dict, cap)) != NULL) { entry->flags &= ~CAP_ORPHANED; + if (ownerdata != NULL) + { + s_assert(entry->ownerdata == NULL); + entry->ownerdata = ownerdata; + } return (1 << entry->value); }