1
0
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:
Noel Power 2019-06-12 14:55:43 +00:00 committed by Noel Power
parent e28365c515
commit 7987e4af96

View File

@ -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;