From Volker L
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Mon, 15 Sep 2008 20:50:28 +0000 (06:50 +1000)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Mon, 15 Sep 2008 20:50:28 +0000 (06:50 +1000)
Fix a slow memory leak in the recovery daemon if there is a recoery
triggered during the public ip reassignment process

server/ctdb_recoverd.c

index 47539427a05ae529dd5a8dadeadc14bb6d63c3e6..af1c358ff055ec9bf802f2ee7ac73b713d63c29f 100644 (file)
@@ -2181,6 +2181,7 @@ static int verify_ip_allocation(struct ctdb_context *ctdb, uint32_t pnn)
        if (timeval_compare(&uptime1->last_recovery_started,
                            &uptime2->last_recovery_started) != 0) {
                DEBUG(DEBUG_NOTICE, (__location__ " last recovery time changed while we read the public ip list. skipping public ip address check\n"));
+               talloc_free(mem_ctx);
                return 0;
        }
 
@@ -2188,6 +2189,7 @@ static int verify_ip_allocation(struct ctdb_context *ctdb, uint32_t pnn)
        if (timeval_compare(&uptime1->last_recovery_finished,
                            &uptime2->last_recovery_finished) != 0) {
                DEBUG(DEBUG_NOTICE, (__location__ " last recovery time changed while we read the public ip list. skipping public ip address check\n"));
+               talloc_free(mem_ctx);
                return 0;
        }
 
@@ -2195,6 +2197,7 @@ static int verify_ip_allocation(struct ctdb_context *ctdb, uint32_t pnn)
        if (timeval_compare(&uptime1->last_recovery_finished,
                            &uptime1->last_recovery_started) != 1) {
                DEBUG(DEBUG_NOTICE, (__location__ " in the middle of recovery. skipping public ip address check\n"));
+               talloc_free(mem_ctx);
 
                return 0;
        }