callerid: catch find_umode_slot() failures

This commit is contained in:
Ariadne Conill 2020-06-26 15:32:11 -06:00
parent db80763427
commit fdff78f891

View file

@ -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");