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

Lines changed: 4 additions & 2 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy