!1686 修复逻辑复制内存泄露的问题

Merge pull request !1686 from pengjiong/2.0/0
This commit is contained in:
opengauss-bot 2022-04-21 11:18:08 +00:00 committed by Gitee
commit c7dddf6ace
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 1 additions and 2 deletions

View File

@ -1977,6 +1977,7 @@ static void HandleWalReplicationCommand(const char *cmd_string, ReplicationCxt*
cmd_context = AllocSetContextCreate(CurrentMemoryContext, "Replication command context", ALLOCSET_DEFAULT_MINSIZE,
ALLOCSET_DEFAULT_INITSIZE, ALLOCSET_DEFAULT_MAXSIZE);
old_context = MemoryContextSwitchTo(cmd_context);
yyscanner = replication_scanner_init(cmd_string);
parse_rc = replication_yyparse(yyscanner);
@ -1987,8 +1988,6 @@ static void HandleWalReplicationCommand(const char *cmd_string, ReplicationCxt*
(errcode(ERRCODE_SYNTAX_ERROR), (errmsg_internal("replication command parser returned %d", parse_rc))));
}
old_context = MemoryContextSwitchTo(cmd_context);
cmd_node = t_thrd.replgram_cxt.replication_parse_result;
IdentifyCommand(cmd_node, repCxt, cmd_string);