mirror of
https://github.com/samba-team/samba.git
synced 2025-01-11 05:18:09 +03:00
lib/tdb: clang: Fix warning: Dereference of null pointer
Fixes: lib/tdb/common/lock.c:933:6: warning: Dereference of null pointer <--[clang] if (tdb->allrecord_lock.count) { ^~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
This commit is contained in:
parent
e28365c515
commit
7987e4af96
@ -927,6 +927,9 @@ int tdb_lock_record(struct tdb_context *tdb, tdb_off_t off)
|
||||
int tdb_write_lock_record(struct tdb_context *tdb, tdb_off_t off)
|
||||
{
|
||||
struct tdb_traverse_lock *i;
|
||||
if (tdb == NULL) {
|
||||
return -1;
|
||||
}
|
||||
for (i = &tdb->travlocks; i; i = i->next)
|
||||
if (i->off == off)
|
||||
return -1;
|
||||
|
Loading…
Reference in New Issue
Block a user