ctdb-client: transaction_cancel must free transaction handle
authorAmitay Isaacs <amitay@gmail.com>
Fri, 5 Aug 2016 03:10:28 +0000 (13:10 +1000)
committerMartin Schwenke <martins@samba.org>
Mon, 8 Aug 2016 06:17:34 +0000 (08:17 +0200)
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>
ctdb/client/client_db.c

index 98de1b858b3d4594a02a8a515626fed80e643bfc..794119d2f0d43537373f35fea9cc3fc8ecf0afee 100644 (file)
@@ -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;
        }