Add some debugging printfs when malloc fails and we don't have an
explicit call to sudo_warnx().
This commit is contained in:
@@ -131,8 +131,11 @@ register_hook_internal(struct sudo_hook_list *head,
|
||||
struct sudo_hook_entry *hook;
|
||||
debug_decl(register_hook_internal, SUDO_DEBUG_HOOKS)
|
||||
|
||||
if ((hook = calloc(1, sizeof(*hook))) == NULL)
|
||||
if ((hook = calloc(1, sizeof(*hook))) == NULL) {
|
||||
sudo_debug_printf(SUDO_DEBUG_ERROR|SUDO_DEBUG_LINENO,
|
||||
"unable to allocate memory");
|
||||
debug_return_int(-1);
|
||||
}
|
||||
hook->u.generic_fn = hook_fn;
|
||||
hook->closure = closure;
|
||||
SLIST_INSERT_HEAD(head, hook, entries);
|
||||
|
Reference in New Issue
Block a user