regonlymsg: catch find_umode_slot() failure

This commit is contained in:
Ariadne Conill 2020-06-26 14:32:46 -06:00
parent daaf127d84
commit 2bbfce681f

View file

@ -40,6 +40,7 @@
#include "numeric.h"
#include "privilege.h"
#include "s_newconf.h"
#include "logger.h"
static int
um_regonlymsg_modinit(void)
@ -47,6 +48,12 @@ um_regonlymsg_modinit(void)
user_modes['R'] = find_umode_slot();
construct_umodebuf();
if (!user_modes['R'])
{
ierror("um_regonlymsg: unable to allocate usermode slot for +R, unloading module");
return -1;
}
return 0;
}