diff options
author | Amitay Isaacs <amitay@gmail.com> | 2014-03-11 18:56:22 +1100 |
---|---|---|
committer | Martin Schwenke <martins@samba.org> | 2014-03-28 03:30:09 +0100 |
commit | ff1c85ae279a87d9ce23955b02a68814f1f846f1 (patch) | |
tree | ef2c219f40f0f0b5d933e56bff252b258f41d2a6 /ctdb | |
parent | 2e2137f56de2c763b874562868d9879d2ae24fee (diff) | |
download | samba-ff1c85ae279a87d9ce23955b02a68814f1f846f1.tar.gz samba-ff1c85ae279a87d9ce23955b02a68814f1f846f1.tar.xz samba-ff1c85ae279a87d9ce23955b02a68814f1f846f1.zip |
ctdb-locking: Avoid memory leak
If lock_request could not be allocated, free lock_ctx since there can
only be a single lock_request per lock_ctx.
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Diffstat (limited to 'ctdb')
-rw-r--r-- | ctdb/server/ctdb_lock.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/ctdb/server/ctdb_lock.c b/ctdb/server/ctdb_lock.c index b71fac28f19..c588c8b1169 100644 --- a/ctdb/server/ctdb_lock.c +++ b/ctdb/server/ctdb_lock.c @@ -948,6 +948,7 @@ static struct lock_request *ctdb_lock_internal(struct ctdb_context *ctdb, } if ((request = talloc_zero(lock_ctx, struct lock_request)) == NULL) { + talloc_free(lock_ctx); return NULL; } |