mirror of
https://github.com/samba-team/samba.git
synced 2025-01-11 05:18:09 +03:00
lib/tdb/common: Fix Array access results in a null pointer dereference
Fixes; lib/tdb/common/transaction.c:613:7: warning: Array access (via field 'blocks') results in a null pointer dereference <--[clang] if (tdb->transaction->blocks[i] != NULL) { ^ 1 warning generated. Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
This commit is contained in:
parent
848290d37f
commit
9e78f7b53d
@ -610,7 +610,8 @@ static int _tdb_transaction_cancel(struct tdb_context *tdb)
|
||||
|
||||
/* free all the transaction blocks */
|
||||
for (i=0;i<tdb->transaction->num_blocks;i++) {
|
||||
if (tdb->transaction->blocks[i] != NULL) {
|
||||
if (tdb->transaction->blocks &&
|
||||
tdb->transaction->blocks[i] != NULL) {
|
||||
free(tdb->transaction->blocks[i]);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user