diff options
author | Noel Power <noel.power@suse.com> | 2019-06-14 13:36:31 +0000 |
---|---|---|
committer | Noel Power <npower@samba.org> | 2019-06-26 10:30:23 +0000 |
commit | 37add5c8ce705f9a2d0ab77d6ef07885d72463c7 (patch) | |
tree | 1fc4d0c4d9c63fef0af8184da41a04a857ac61e5 /lib/dbwrap | |
parent | 1d00bd9f0ba7849e98b6a437ef29aeea725b5444 (diff) | |
download | samba-37add5c8ce705f9a2d0ab77d6ef07885d72463c7.tar.gz |
lib/dbwrap: clang: Fix 'all argument is an uninitialized value'
Fixes:
lib/dbwrap/dbwrap.c:533:4: warning: 2nd function call argument is an uninitialized value <--[clang]
dbwrap_lock_order_unlock(db, lockptr);
^
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Diffstat (limited to 'lib/dbwrap')
-rw-r--r-- | lib/dbwrap/dbwrap.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/dbwrap/dbwrap.c b/lib/dbwrap/dbwrap.c index 5e307ee47cd..29815cb07af 100644 --- a/lib/dbwrap/dbwrap.c +++ b/lib/dbwrap/dbwrap.c @@ -520,7 +520,7 @@ NTSTATUS dbwrap_do_locked(struct db_context *db, TDB_DATA key, struct db_record *rec; if (db->do_locked != NULL) { - struct db_context **lockptr; + struct db_context **lockptr = NULL; NTSTATUS status; if (db->lock_order != DBWRAP_LOCK_ORDER_NONE) { @@ -529,7 +529,8 @@ NTSTATUS dbwrap_do_locked(struct db_context *db, TDB_DATA key, status = db->do_locked(db, key, fn, private_data); - if (db->lock_order != DBWRAP_LOCK_ORDER_NONE) { + if (db->lock_order != DBWRAP_LOCK_ORDER_NONE && + lockptr != NULL) { dbwrap_lock_order_unlock(db, lockptr); } |