From 877f0b69e32080bf69b6415fc7730dc03094c32d Mon Sep 17 00:00:00 2001 From: chenxiaobin <1025221611@qq.com> Date: Fri, 1 Apr 2022 06:53:42 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dmxid=5Fto=5Fstring=E5=9C=A8To?= =?UTF-8?q?pMemoryContext=E5=88=86=E9=85=8D=E5=86=85=E5=AD=98=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/gausskernel/storage/access/transam/multixact.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/gausskernel/storage/access/transam/multixact.cpp b/src/gausskernel/storage/access/transam/multixact.cpp index fccc7cf85..f29f2eb24 100644 --- a/src/gausskernel/storage/access/transam/multixact.cpp +++ b/src/gausskernel/storage/access/transam/multixact.cpp @@ -1278,13 +1278,10 @@ static const char *MXStatusToString(MultiXactStatus status) static char *mxid_to_string(MultiXactId multi, int nmembers, MultiXactMember *members) { - static char *str = NULL; + char *str = NULL; StringInfoData buf; int i; - if (str != NULL) - pfree(str); - initStringInfo(&buf); appendStringInfo(&buf, XID_FMT " %d[" XID_FMT " (%s)", multi, nmembers, @@ -1295,7 +1292,7 @@ static char *mxid_to_string(MultiXactId multi, int nmembers, MultiXactMember *me } appendStringInfoChar(&buf, ']'); - str = MemoryContextStrdup(TopMemoryContext, buf.data); + str = MemoryContextStrdup(SESS_GET_MEM_CXT_GROUP(MEMORY_CONTEXT_STORAGE), buf.data); pfree(buf.data); return str; }