ctdb-recoverd: Remove unused memory context variable
authorMartin Schwenke <martin@meltin.net>
Mon, 30 Mar 2015 10:52:45 +0000 (21:52 +1100)
committerAmitay Isaacs <amitay@samba.org>
Sun, 10 May 2015 01:22:13 +0000 (03:22 +0200)
It is set, memory is allocated but it is never used.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/server/ctdb_recoverd.c

index 507bae971cfa24b15241c476669fa386bd4d8b32..ca4aa1718cda1756cd9878eb586833e6a2a7be69 100644 (file)
@@ -2714,7 +2714,6 @@ static void election_handler(struct ctdb_context *ctdb, uint64_t srvid,
        struct ctdb_recoverd *rec = talloc_get_type(private_data, struct ctdb_recoverd);
        int ret;
        struct election_message *em = (struct election_message *)data.dptr;
-       TALLOC_CTX *mem_ctx;
 
        /* Ignore election packets from ourself */
        if (ctdb->pnn == em->pnn) {
@@ -2729,8 +2728,6 @@ static void election_handler(struct ctdb_context *ctdb, uint64_t srvid,
                                                timeval_current_ofs(ctdb->tunable.election_timeout, 0), 
                                                ctdb_election_timeout, rec);
 
-       mem_ctx = talloc_new(ctdb);
-
        /* someone called an election. check their election data
           and if we disagree and we would rather be the elected node, 
           send a new election message to all other nodes
@@ -2741,7 +2738,6 @@ static void election_handler(struct ctdb_context *ctdb, uint64_t srvid,
                                                                timeval_current_ofs(0, 500000),
                                                                election_send_request, rec);
                }
-               talloc_free(mem_ctx);
                /*unban_all_nodes(ctdb);*/
                return;
        }
@@ -2763,11 +2759,9 @@ static void election_handler(struct ctdb_context *ctdb, uint64_t srvid,
        ret = ctdb_ctrl_setrecmaster(ctdb, CONTROL_TIMEOUT(), ctdb_get_pnn(ctdb), em->pnn);
        if (ret != 0) {
                DEBUG(DEBUG_ERR, (__location__ " failed to send recmaster election request"));
-               talloc_free(mem_ctx);
                return;
        }
 
-       talloc_free(mem_ctx);
        return;
 }