Merge pull request #311 from luismerino/dynlibmod-leak

Dynlibmod leak
This commit is contained in:
Wouter Wijngaards 2020-09-21 10:12:19 +02:00 committed by GitHub
commit 8deb912fa9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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) {
@ -253,6 +255,7 @@ inplace_cb_register_wrapped(void* cb, enum inplace_cb_list_type type, void* cbar
} else if(type == inplace_cb_edns_back_parsed) {
return inplace_cb_register(&dynlib_inplace_cb_edns_back_parsed, type, (void*) cb_pair, env, id);
} else {
free(cb_pair);
return 0;
}
}