]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
libnet4: free tevent request even on error
authorBjörn Baumbach <bb@sernet.de>
Mon, 10 Feb 2025 16:42:12 +0000 (17:42 +0100)
committerBjörn Baumbach <bb@sernet.de>
Tue, 11 Feb 2025 11:05:37 +0000 (11:05 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15798

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Björn Baumbach <bb@sernet.de>
Autobuild-Date(master): Tue Feb 11 11:05:37 UTC 2025 on atb-devel-224

source4/libnet/libnet_lookup.c

index 26cf26fe3e1e6200ce700f05bca08436c0f5327d..fe021b9f4d89cdfabc3792504150f14f850e84fb 100644 (file)
@@ -223,10 +223,10 @@ NTSTATUS libnet_LookupDCs_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
        NTSTATUS status;
        struct finddcs finddcs_io;
        status = finddcs_cldap_recv(req, mem_ctx, &finddcs_io);
+       talloc_free(req);
        if (!NT_STATUS_IS_OK(status)) {
                return status;
        }
-       talloc_free(req);
        io->out.num_dcs = 1;
        io->out.dcs = talloc(mem_ctx, struct nbt_dc_name);
        NT_STATUS_HAVE_NO_MEMORY(io->out.dcs);