]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
libnet3: Fix Coverity ID 1034874 Resource leak
authorVolker Lendecke <vl@samba.org>
Fri, 15 Nov 2024 10:17:42 +0000 (11:17 +0100)
committerRalph Boehme <slow@samba.org>
Tue, 19 Nov 2024 18:11:29 +0000 (18:11 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/libnet/libnet_join.c

index 76ffe5ed2bb64e949e0626124ca708c21652fa1c..fb5dfa33c90934508b05c647b497fad803bf1346 100644 (file)
@@ -893,12 +893,11 @@ static bool libnet_join_derive_salting_principal(TALLOC_CTX *mem_ctx,
        }
 
        salt = talloc_strdup(mem_ctx, std_salt);
+       SAFE_FREE(std_salt);
        if (!salt) {
                return false;
        }
 
-       SAFE_FREE(std_salt);
-
        /* if it's a Windows functional domain, we have to look for the UPN */
 
        if (domain_func == DS_DOMAIN_FUNCTION_2000) {