]> jfr.im git - irc/freenode/ircd-seven.git/commitdiff
callerid: catch find_umode_slot() failures
authorAriadne Conill <redacted>
Fri, 26 Jun 2020 21:32:11 +0000 (15:32 -0600)
committerAriadne Conill <redacted>
Thu, 9 Jul 2020 22:06:33 +0000 (16:06 -0600)
modules/um_callerid.c

index 5aa50438b322725d69b743e05694715012435fbe..f483dd4753b28116e4b07949b9b3aad046e59100 100644 (file)
 #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");