mirror of
https://github.com/NLnetLabs/unbound.git
synced 2025-12-20 23:00:56 -05:00
fix: return error when malloc fails in inplace_cb_register_wrapped()
This commit is contained in:
parent
6ea24c5c86
commit
56e0e5b9af
1 changed files with 2 additions and 0 deletions
|
|
@ -242,6 +242,8 @@ int
|
|||
inplace_cb_register_wrapped(void* cb, enum inplace_cb_list_type type, void* cbarg,
|
||||
struct module_env* env, int id) {
|
||||
struct cb_pair* cb_pair = malloc(sizeof(struct cb_pair));
|
||||
if(cb_pair == NULL)
|
||||
return 0;
|
||||
cb_pair->cb = cb;
|
||||
cb_pair->cb_arg = cbarg;
|
||||
if(type >= inplace_cb_reply && type <= inplace_cb_reply_servfail) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue