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

ctdb-locking: Check for talloc_memdup error

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
This commit is contained in:
Amitay Isaacs 2014-03-11 18:57:08 +11:00 committed by Martin Schwenke
parent ff1c85ae27
commit d1c8f8d635

View File

@ -927,6 +927,11 @@ static struct lock_request *ctdb_lock_internal(struct ctdb_context *ctdb,
lock_ctx->key.dsize = key.dsize;
if (key.dsize > 0) {
lock_ctx->key.dptr = talloc_memdup(lock_ctx, key.dptr, key.dsize);
if (lock_ctx->key.dptr == NULL) {
DEBUG(DEBUG_ERR, (__location__ "Memory allocation error\n"));
talloc_free(lock_ctx);
return NULL;
}
} else {
lock_ctx->key.dptr = NULL;
}