From 358e001218521aae1778f8e3f0f95f73b6a403c1 Mon Sep 17 00:00:00 2001 From: Andrzej Nowicki Date: Tue, 13 Mar 2018 11:05:24 +0100 Subject: [PATCH 1/2] Clear node list to avoid memory leak, fixes #402 --- dbutils.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dbutils.c b/dbutils.c index facf2d82..f4a5327e 100644 --- a/dbutils.c +++ b/dbutils.c @@ -2628,6 +2628,8 @@ witness_copy_node_records(PGconn *primary_conn, PGconn *witness_conn) /* and done */ commit_transaction(witness_conn); + clear_node_info_list(&nodes); + return true; } From d2a2df13d5c036b81c4d6554341f0162ab042d98 Mon Sep 17 00:00:00 2001 From: Andrzej Nowicki Date: Tue, 13 Mar 2018 11:23:33 +0100 Subject: [PATCH 2/2] One more memory leak fixed --- dbutils.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dbutils.c b/dbutils.c index f4a5327e..4f392fc9 100644 --- a/dbutils.c +++ b/dbutils.c @@ -2608,6 +2608,7 @@ witness_copy_node_records(PGconn *primary_conn, PGconn *witness_conn) return false; } + PQclear(res); /* truncate existing records */