git.samba.org
/
ctdb.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
edbea6c
)
locking: Check for talloc_memdup error
author
Amitay Isaacs
<amitay@gmail.com>
Tue, 11 Mar 2014 07:57:08 +0000
(18:57 +1100)
committer
Amitay Isaacs
<amitay@gmail.com>
Fri, 28 Mar 2014 04:42:56 +0000
(15:42 +1100)
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
(Imported from commit
d1c8f8d63506c099e2ee9be7cb91f0fac4a8d848
)
server/ctdb_lock.c
patch
|
blob
|
history
diff --git
a/server/ctdb_lock.c
b/server/ctdb_lock.c
index c588c8b11692d5512ae694d00440cbf748da91d9..9d3b7c100343378fced0f85596d49f6ac51e0498 100644
(file)
--- a/
server/ctdb_lock.c
+++ b/
server/ctdb_lock.c
@@
-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;
}