s3/passdb: clang: Fix 'Value stored during initialization is never read'
authorNoel Power <noel.power@suse.com>
Thu, 5 Sep 2019 13:36:22 +0000 (13:36 +0000)
committerJeremy Allison <jra@samba.org>
Thu, 26 Sep 2019 18:41:26 +0000 (18:41 +0000)
Fixes:

source3/passdb/pdb_interface.c:65:34: warning: Value stored to 'entry' during its initialization is never read <--[clang]
        struct pdb_init_function_entry *entry = backends;
                                        ^~~~~   ~~~~~~~~

/source3/passdb/pdb_interface.c:140:11: warning: Value stored to 'nt_status' during its initialization is never read <--[clang]
        NTSTATUS nt_status = NT_STATUS_UNSUCCESSFUL;
                 ^~~~~~~~~   ~~~~~~~~~~~~~~~~~~~~~~
2 warnings generated.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/passdb/pdb_interface.c

index d42d5e52932050b4e63364f6d26a53b743caa57c..556839ae9d1238937e54d6e70b64f25abd76b841 100644 (file)
@@ -62,7 +62,7 @@ static bool lookup_global_sam_rid(TALLOC_CTX *mem_ctx, uint32_t rid,
 
 NTSTATUS smb_register_passdb(int version, const char *name, pdb_init_function init) 
 {
-       struct pdb_init_function_entry *entry = backends;
+       struct pdb_init_function_entry *entry = NULL;
 
        if(version != PASSDB_INTERFACE_VERSION) {
                DEBUG(0,("Can't register passdb backend!\n"
@@ -137,7 +137,7 @@ NTSTATUS make_pdb_method_name(struct pdb_methods **methods, const char *selected
        char *module_name = smb_xstrdup(selected);
        char *module_location = NULL, *p;
        struct pdb_init_function_entry *entry;
-       NTSTATUS nt_status = NT_STATUS_UNSUCCESSFUL;
+       NTSTATUS nt_status;
 
        lazy_initialize_passdb();