From fdff78f8912e225894af21622416cbf6f0cc9239 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Fri, 26 Jun 2020 15:32:11 -0600 Subject: [PATCH] callerid: catch find_umode_slot() failures --- modules/um_callerid.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/modules/um_callerid.c b/modules/um_callerid.c index 5aa50438..f483dd47 100644 --- a/modules/um_callerid.c +++ b/modules/um_callerid.c @@ -42,12 +42,25 @@ #include "s_newconf.h" #include "hook.h" #include "supported.h" +#include "logger.h" static int um_callerid_modinit(void) { user_modes['g'] = find_umode_slot(); + if (!user_modes['g']) + { + ierror("um_callerid: unable to allocate usermode slot for +g; unloading module."); + return -1; + } + user_modes['G'] = find_umode_slot(); + if (!user_modes['G']) + { + ierror("um_callerid: unable to allocate usermode slot for +G; unloading module."); + return -1; + } + construct_umodebuf(); add_isupport("CALLERID", isupport_string, "g");