fix: return error when malloc fails in inplace_cb_register_wrapped()

This commit is contained in:
L. Merino 2020-09-19 09:48:09 +02:00
parent 6ea24c5c86
commit 56e0e5b9af

View file

@ -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) {