From: Joseph Sutton Date: Mon, 25 Sep 2023 01:40:50 +0000 (+1300) Subject: s4:dsdb: Initialize pointers to NULL X-Git-Tag: talloc-2.4.2~1010 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2944bc1e02a279771a4514a09d1b92ef29d7a07d;p=thirdparty%2Fsamba.git s4:dsdb: Initialize pointers to NULL Signed-off-by: Joseph Sutton Reviewed-by: Andrew Bartlett --- diff --git a/source4/dsdb/samdb/ldb_modules/acl.c b/source4/dsdb/samdb/ldb_modules/acl.c index b4def1411bc..69709af4cfe 100644 --- a/source4/dsdb/samdb/ldb_modules/acl.c +++ b/source4/dsdb/samdb/ldb_modules/acl.c @@ -460,9 +460,9 @@ static int acl_validate_spn_value(TALLOC_CTX *mem_ctx, krb5_context krb_ctx; krb5_error_code kerr; krb5_principal principal; - char *instanceName; - char *serviceType; - char *serviceName; + char *instanceName = NULL; + char *serviceType = NULL; + char *serviceName = NULL; const char *spn_value_str = NULL; size_t account_name_len; const char *forest_name = samdb_forest_name(ldb, mem_ctx); @@ -516,8 +516,6 @@ static int acl_validate_spn_value(TALLOC_CTX *mem_ctx, if (krb5_princ_size(krb_ctx, principal) == 3) { serviceName = smb_krb5_principal_get_comp_string(mem_ctx, krb_ctx, principal, 2); - } else { - serviceName = NULL; } if (serviceName) { @@ -576,7 +574,7 @@ static int acl_validate_spn_value(TALLOC_CTX *mem_ctx, goto success; } if (is_dc) { - const char *guid_str; + const char *guid_str = NULL; guid_str = talloc_asprintf(mem_ctx,"%s._msdcs.%s", ntds_guid, forest_name);