]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
auth: Direct variable initialization
authorVolker Lendecke <vl@samba.org>
Thu, 19 Jun 2025 15:44:31 +0000 (17:44 +0200)
committerAnoop C S <anoopcs@samba.org>
Fri, 20 Jun 2025 11:12:14 +0000 (11:12 +0000)
talloc_stackframe() panics on failure

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Fri Jun 20 11:12:14 UTC 2025 on atb-devel-224

source3/auth/auth_util.c

index c01bab5ed348cfa34f774f6088763ea24667ed3a..b7a81f09c9e9a05759ba1a0f49206049fb8edaf4 100644 (file)
@@ -1399,17 +1399,10 @@ static NTSTATUS make_new_session_info_guest(TALLOC_CTX *mem_ctx,
        struct auth_serversupplied_info *server_info = NULL;
        const char *guest_account = lp_guest_account();
        const char *domain = lp_netbios_name();
-       struct netr_SamInfo3 info3;
-       TALLOC_CTX *tmp_ctx;
+       struct netr_SamInfo3 info3 = {};
+       TALLOC_CTX *tmp_ctx = talloc_stackframe();
        NTSTATUS status;
 
-       tmp_ctx = talloc_stackframe();
-       if (tmp_ctx == NULL) {
-               return NT_STATUS_NO_MEMORY;
-       }
-
-       ZERO_STRUCT(info3);
-
        status = get_guest_info3(tmp_ctx, &info3);
        if (!NT_STATUS_IS_OK(status)) {
                DEBUG(0, ("get_guest_info3 failed with %s\n",