summaryrefslogtreecommitdiffstats
path: root/ctdb/server/ctdb_recoverd.c
diff options
context:
space:
mode:
authorRonnie Sahlberg <ronniesahlberg@gmail.com>2008-09-16 07:55:57 +1000
committerRonnie Sahlberg <ronniesahlberg@gmail.com>2008-09-16 07:55:57 +1000
commit7b718fffd7afdeb416bf3146f07be41eeec12613 (patch)
tree1c3fa4dd8695fc8ba22faf8315d3ef7fb9d431d4 /ctdb/server/ctdb_recoverd.c
parentab3649155a089a4b7ed1e418b413b1b37771cd95 (diff)
downloadsamba-7b718fffd7afdeb416bf3146f07be41eeec12613.tar.gz
samba-7b718fffd7afdeb416bf3146f07be41eeec12613.tar.xz
samba-7b718fffd7afdeb416bf3146f07be41eeec12613.zip
fix some slow memory leaks in the vacuuming handler in the recovery
daemon (This used to be ctdb commit 95bf36559d62f29e6f538f3a173b504ef3258341)
Diffstat (limited to 'ctdb/server/ctdb_recoverd.c')
-rw-r--r--ctdb/server/ctdb_recoverd.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ctdb/server/ctdb_recoverd.c b/ctdb/server/ctdb_recoverd.c
index af1c358ff05..779d26f3e45 100644
--- a/ctdb/server/ctdb_recoverd.c
+++ b/ctdb/server/ctdb_recoverd.c
@@ -880,6 +880,7 @@ static void vacuum_fetch_handler(struct ctdb_context *ctdb, uint64_t srvid,
r = (struct ctdb_rec_data *)&recs->data[0];
if (recs->count == 0) {
+ talloc_free(tmp_ctx);
return;
}
@@ -888,6 +889,7 @@ static void vacuum_fetch_handler(struct ctdb_context *ctdb, uint64_t srvid,
for (v=rec->vacuum_info;v;v=v->next) {
if (srcnode == v->srcnode && recs->db_id == v->ctdb_db->db_id) {
/* we're already working on records from this node */
+ talloc_free(tmp_ctx);
return;
}
}
@@ -930,6 +932,7 @@ static void vacuum_fetch_handler(struct ctdb_context *ctdb, uint64_t srvid,
v = talloc_zero(rec, struct vacuum_info);
if (v == NULL) {
DEBUG(DEBUG_CRIT,(__location__ " Out of memory\n"));
+ talloc_free(tmp_ctx);
return;
}
@@ -940,6 +943,7 @@ static void vacuum_fetch_handler(struct ctdb_context *ctdb, uint64_t srvid,
if (v->recs == NULL) {
DEBUG(DEBUG_CRIT,(__location__ " Out of memory\n"));
talloc_free(v);
+ talloc_free(tmp_ctx);
return;
}
v->r = (struct ctdb_rec_data *)&v->recs->data[0];
@@ -949,6 +953,7 @@ static void vacuum_fetch_handler(struct ctdb_context *ctdb, uint64_t srvid,
talloc_set_destructor(v, vacuum_info_destructor);
vacuum_fetch_next(v);
+ talloc_free(tmp_ctx);
}