]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
fix: return error when malloc fails in inplace_cb_register_wrapped()
authorL. Merino <luismiguelmerino@gmail.com>
Sat, 19 Sep 2020 07:48:09 +0000 (09:48 +0200)
committerL. Merino <luismiguelmerino@gmail.com>
Sat, 19 Sep 2020 07:58:32 +0000 (09:58 +0200)
dynlibmod/dynlibmod.c

index f9751d8c6f73a68c3a0e51443354747f7adc925a..2bd4a28c186be58008ff7bcce591765d8b1a6c76 100644 (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) {