summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmitay Isaacs <amitay@gmail.com>2016-08-05 13:10:28 +1000
committerStefan Metzmacher <metze@samba.org>2016-08-10 11:24:37 +0200
commit34c34998b1a8b137d51413af3c6831cf827dbbef (patch)
tree55976652ae571e73b084e7264c794a408ac67736
parent533d7e1b911345d76450b221fb86ec8d66289f08 (diff)
downloadsamba-34c34998b1a8b137d51413af3c6831cf827dbbef.tar.gz
ctdb-client: transaction_cancel must free transaction handle
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12122 Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net> (cherry picked from commit 8aa00035faeb307c061dc20e62a0ace7f2a1413b)
-rw-r--r--ctdb/client/client_db.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ctdb/client/client_db.c b/ctdb/client/client_db.c
index 98de1b858b3..794119d2f0d 100644
--- a/ctdb/client/client_db.c
+++ b/ctdb/client/client_db.c
@@ -2304,6 +2304,7 @@ static void ctdb_transaction_cancel_done(struct tevent_req *subreq)
DEBUG(DEBUG_ERR,
("transaction_cancel: %s g_lock unlock failed, ret=%d\n",
state->h->db->db_name, ret));
+ talloc_free(state->h);
tevent_req_error(req, ret);
return;
}
@@ -2336,6 +2337,7 @@ int ctdb_transaction_cancel(struct ctdb_transaction_handle *h)
mem_ctx = talloc_new(NULL);
if (mem_ctx == NULL) {
+ talloc_free(h);
return ENOMEM;
}
@@ -2343,6 +2345,7 @@ int ctdb_transaction_cancel(struct ctdb_transaction_handle *h)
tevent_timeval_zero(), h);
if (req == NULL) {
talloc_free(mem_ctx);
+ talloc_free(h);
return ENOMEM;
}