Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 67d955d

Browse files
committed
Allocate MtmDatabaseName in TopMemoryContext
1 parent 6657d85 commit 67d955d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

contrib/mmts/multimaster.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -2163,6 +2163,7 @@ static void MtmSplitConnStrs(void)
21632163
int i;
21642164
FILE* f = NULL;
21652165
char buf[MULTIMASTER_MAX_CTL_STR_SIZE];
2166+
MemoryContext old_context = MemoryContextSwitchTo(TopMemoryContext);
21662167

21672168
if (*MtmConnStrs == '@') {
21682169
f = fopen(MtmConnStrs+1, "r");
@@ -2276,8 +2277,9 @@ static void MtmSplitConnStrs(void)
22762277
Assert(end != NULL);
22772278
len = end - dbName;
22782279
MtmDatabaseName = pnstrdup(dbName, len);
2279-
}
2280-
}
2280+
}
2281+
MemoryContextSwitchTo(old_context);
2282+
}
22812283

22822284
static bool ConfigIsSane(void)
22832285
{

0 commit comments

Comments
 (0)