diff --git a/source3/libnet/libnet_join.c b/source3/libnet/libnet_join.c index 76ffe5ed2bb..fb5dfa33c90 100644 --- a/source3/libnet/libnet_join.c +++ b/source3/libnet/libnet_join.c @@ -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) {