From dee1ecfa79939384f7e92a91642b29fc0bf5fdce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AA=86=E6=B4=AA=E6=96=8C?= Date: Mon, 28 Sep 2020 15:17:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9pt=5Fctl=E5=86=85=E5=AD=98?= =?UTF-8?q?=E6=B3=84=E6=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/bin/pg_ctl/pg_ctl.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/bin/pg_ctl/pg_ctl.cpp b/src/bin/pg_ctl/pg_ctl.cpp index a6228eb41..6bc30e0fe 100644 --- a/src/bin/pg_ctl/pg_ctl.cpp +++ b/src/bin/pg_ctl/pg_ctl.cpp @@ -3900,6 +3900,7 @@ static void do_incremental_build(uint32 term) } if (status == BUILD_SUCCESS) { /* pg_ctl start -M standby */ + FREE_AND_RESET(pgha_opt); pgha_opt = (char*)pg_malloc(sizeof(standbymode_str)); tnRet = snprintf_s(pgha_opt, sizeof(standbymode_str), sizeof(standbymode_str) - 1, "%s", standbymode_str); securec_check_ss_c(tnRet, "\0", "\0"); @@ -4013,6 +4014,7 @@ static void do_actual_build(uint32 term) */ if (conn_str == NULL) { /* pg_ctl start -M standby */ + FREE_AND_RESET(pgha_opt); pgha_opt = (char*)pg_malloc(sizeof(standbymode_str)); tnRet = snprintf_s(pgha_opt, sizeof(standbymode_str), sizeof(standbymode_str) - 1, "%s", standbymode_str); securec_check_ss_c(tnRet, "\0", "\0");