From: Nick Porter Date: Thu, 7 Sep 2023 18:13:59 +0000 (+0100) Subject: Ensure we free memory on errors X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2a0a4932b257ccc720b6ec4e4be3501eaecb03b7;p=thirdparty%2Ffreeradius-server.git Ensure we free memory on errors --- diff --git a/src/modules/rlm_unbound/rlm_unbound.c b/src/modules/rlm_unbound/rlm_unbound.c index 1085ea2030f..14720c2e76b 100644 --- a/src/modules/rlm_unbound/rlm_unbound.c +++ b/src/modules/rlm_unbound/rlm_unbound.c @@ -433,6 +433,8 @@ static int mod_thread_instantiate(module_thread_inst_ctx_t const *mctx) if (res) { error: PERROR("%s", ub_strerror(res)); + free_error: + talloc_free(t->ev_b); return -1; } @@ -444,7 +446,7 @@ static int mod_thread_instantiate(module_thread_inst_ctx_t const *mctx) if (unbound_log_init(t, &t->u_log, t->ev_b->ub) < 0) { PERROR("Failed to initialise unbound log"); - return -1; + goto free_error; } /*