Skip to content

Commit 9fc7dc3

Browse files
committed
Allocate MtmDatabaseName in TopMemoryContext
1 parent a208d57 commit 9fc7dc3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

multimaster.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2162,6 +2162,7 @@ static void MtmSplitConnStrs(void)
21622162
int i;
21632163
FILE* f = NULL;
21642164
char buf[MULTIMASTER_MAX_CTL_STR_SIZE];
2165+
MemoryContext old_context = MemoryContextSwitchTo(TopMemoryContext);
21652166

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

22812283
static bool ConfigIsSane(void)
22822284
{

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