summaryrefslogtreecommitdiff
path: root/source3/registry
diff options
context:
space:
mode:
authorNoel Power <noel.power@suse.com>2019-07-10 11:35:35 +0000
committerGary Lockyer <gary@samba.org>2019-07-16 22:52:25 +0000
commit963f58fb622f20d58f9dab2d5f474c7eec58a8e2 (patch)
tree605d7028428cd627861c2852815b544ab45891f2 /source3/registry
parent80e57a10164cc8482f0611cbce4086521051ec9b (diff)
downloadsamba-963f58fb622f20d58f9dab2d5f474c7eec58a8e2.tar.gz
s3/registry: clang: Fix 'initialization value is never read'
Fixes: source3/registry/reg_backend_db.c:853:9: warning: Value stored to 'result' during its initialization is never read <--[clang] WERROR result = WERR_OK; ^~~~~~ ~~~~~~~ source3/registry/reg_backend_db.c:1677:2: warning: Value stored to 'len' is never read <--[clang] len = 0; ^ ~ 2 warnings generated. Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Diffstat (limited to 'source3/registry')
-rw-r--r--source3/registry/reg_backend_db.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/source3/registry/reg_backend_db.c b/source3/registry/reg_backend_db.c
index 7749b812c24..c870dc57ed6 100644
--- a/source3/registry/reg_backend_db.c
+++ b/source3/registry/reg_backend_db.c
@@ -850,20 +850,22 @@ WERROR regdb_init(void)
WERROR regdb_open( void )
{
- WERROR result = WERR_OK;
- char *db_path;
+ WERROR result;
+ char *db_path = NULL;
int saved_errno;
if ( regdb ) {
DEBUG(10, ("regdb_open: incrementing refcount (%d->%d)\n",
regdb_refcount, regdb_refcount+1));
regdb_refcount++;
- return WERR_OK;
+ result = WERR_OK;
+ goto done;
}
db_path = state_path(talloc_tos(), "registry.tdb");
if (db_path == NULL) {
- return WERR_NOT_ENOUGH_MEMORY;
+ result = WERR_NOT_ENOUGH_MEMORY;
+ goto done;
}
become_root();
@@ -877,16 +879,17 @@ WERROR regdb_open( void )
result = ntstatus_to_werror(map_nt_error_from_unix(saved_errno));
DEBUG(0,("regdb_open: Failed to open %s! (%s)\n",
db_path, strerror(saved_errno)));
- TALLOC_FREE(db_path);
- return result;
+ goto done;
}
- TALLOC_FREE(db_path);
regdb_refcount = 1;
DEBUG(10, ("regdb_open: registry db opened. refcount reset (%d)\n",
regdb_refcount));
- return WERR_OK;
+ result = WERR_OK;
+done:
+ TALLOC_FREE(db_path);
+ return result;
}
/***********************************************************************
@@ -1674,8 +1677,6 @@ static bool regdb_key_exists(struct db_context *db, const char *key)
buflen = value.dsize - len;
buf = (const char *)value.dptr + len;
- len = 0;
-
for (i = 0; i < num_items; i++) {
if (buflen == 0) {
break;