1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-02 09:47:23 +03:00

s3/lib/dbwrap: clang: Fix 'Access to field results in a deref of a null'

Fixes:

source3/lib/dbwrap/dbwrap_ctdb.c:530:39: warning: Access to field 'm_write' results in a dereference of a null pointer (loaded from field 'transaction') <--[clang]
        if (pull_newest_from_marshall_buffer(ctx->transaction->m_write, key,

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-07-09 14:42:46 +00:00 committed by Gary Lockyer
parent 6858c83dc6
commit 637cd1a6c4

View File

@ -527,6 +527,11 @@ static struct db_record *db_ctdb_fetch_locked_transaction(struct db_ctdb_ctx *ct
result->storev = db_ctdb_storev_transaction;
result->delete_rec = db_ctdb_delete_transaction;
if (ctx->transaction == NULL) {
DEBUG(0, ("no transaction available\n"));
TALLOC_FREE(result);
return NULL;
}
if (pull_newest_from_marshall_buffer(ctx->transaction->m_write, key,
NULL, result, &result->value)) {
return result;