]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Ensure we free memory on errors
authorNick Porter <nick@portercomputing.co.uk>
Thu, 7 Sep 2023 18:13:59 +0000 (19:13 +0100)
committerNick Porter <nick@portercomputing.co.uk>
Fri, 8 Sep 2023 10:12:37 +0000 (11:12 +0100)
src/modules/rlm_unbound/rlm_unbound.c

index 1085ea2030f1982c26b4c1fa1695660f9135f8b9..14720c2e76ba2813767359d08c4017f1d4c7eb5a 100644 (file)
@@ -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;
        }
 
        /*