regonlymsg: catch find_umode_slot() failure
This commit is contained in:
parent
daaf127d84
commit
2bbfce681f
1 changed files with 7 additions and 0 deletions
|
@ -40,6 +40,7 @@
|
||||||
#include "numeric.h"
|
#include "numeric.h"
|
||||||
#include "privilege.h"
|
#include "privilege.h"
|
||||||
#include "s_newconf.h"
|
#include "s_newconf.h"
|
||||||
|
#include "logger.h"
|
||||||
|
|
||||||
static int
|
static int
|
||||||
um_regonlymsg_modinit(void)
|
um_regonlymsg_modinit(void)
|
||||||
|
@ -47,6 +48,12 @@ um_regonlymsg_modinit(void)
|
||||||
user_modes['R'] = find_umode_slot();
|
user_modes['R'] = find_umode_slot();
|
||||||
construct_umodebuf();
|
construct_umodebuf();
|
||||||
|
|
||||||
|
if (!user_modes['R'])
|
||||||
|
{
|
||||||
|
ierror("um_regonlymsg: unable to allocate usermode slot for +R, unloading module");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue