]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
libcli/auth: add let netlogon_creds_alloc() use _talloc_keep_secret()
authorStefan Metzmacher <metze@samba.org>
Wed, 11 Dec 2024 09:14:44 +0000 (10:14 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Thu, 12 Dec 2024 13:59:29 +0000 (13:59 +0000)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
libcli/auth/credentials.c

index a6770d87cf846570c22f9272ac6d1e0b903005c2..86bb8c338191372dfaab567b71fa60e3de014e6b 100644 (file)
@@ -492,6 +492,7 @@ netlogon_creds_alloc(TALLOC_CTX *mem_ctx,
        struct netlogon_creds_CredentialState *creds = NULL;
        struct timeval tv = timeval_current();
        NTTIME now = timeval_to_nttime(&tv);
+       const char *name = NULL;
 
        creds = talloc_zero(mem_ctx, struct netlogon_creds_CredentialState);
        if (creds == NULL) {
@@ -523,6 +524,8 @@ netlogon_creds_alloc(TALLOC_CTX *mem_ctx,
                creds->client_sid = global_sid_NULL;
        }
 
+       name = talloc_get_name(creds);
+       _talloc_keep_secret(creds, name);
        return creds;
 }