From 1cba9de14444933a51972b725e0f4852704d2a8c Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 22 Jan 2024 21:33:05 +0100 Subject: [PATCH] Fix a few "might be uninitialized" errors I've seen them with clang Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison Autobuild-User(master): Jeremy Allison Autobuild-Date(master): Tue Apr 23 19:02:10 UTC 2024 on atb-devel-224 --- source3/libsmb/libsmb_file.c | 2 +- source4/auth/sam.c | 2 +- source4/dsdb/common/rodc_helper.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source3/libsmb/libsmb_file.c b/source3/libsmb/libsmb_file.c index ff18d569757..5861718d672 100644 --- a/source3/libsmb/libsmb_file.c +++ b/source3/libsmb/libsmb_file.c @@ -470,7 +470,7 @@ SMBC_getatr(SMBCCTX * context, mode_t mode = S_IFREG; struct cli_credentials *creds = NULL; TALLOC_CTX *frame = talloc_stackframe(); - NTSTATUS status; + NTSTATUS status = NT_STATUS_ACCESS_DENIED; if (!context || !context->internal->initialized) { TALLOC_FREE(frame); diff --git a/source4/auth/sam.c b/source4/auth/sam.c index 1445adf2261..bd8219d7335 100644 --- a/source4/auth/sam.c +++ b/source4/auth/sam.c @@ -1581,7 +1581,7 @@ NTSTATUS authsam_logon_success_accounting(struct ldb_context *sam_ctx, NTTIME sync_interval_nt = 0; bool am_rodc = false; bool txn_active = false; - bool need_db_reread; + bool need_db_reread = false; mem_ctx = talloc_new(msg); if (mem_ctx == NULL) { diff --git a/source4/dsdb/common/rodc_helper.c b/source4/dsdb/common/rodc_helper.c index b4982aee9ed..5ed60e0af43 100644 --- a/source4/dsdb/common/rodc_helper.c +++ b/source4/dsdb/common/rodc_helper.c @@ -243,7 +243,7 @@ WERROR samdb_confirm_rodc_allowed_to_repl_to(struct ldb_context *sam_ctx, { TALLOC_CTX *frame = talloc_stackframe(); WERROR werr; - uint32_t num_token_sids; + uint32_t num_token_sids = 0; struct dom_sid *token_sids; const struct dom_sid *object_sid = NULL;