Content-Length: 276535 | pFad | http://github.com/postgrespro/postgres_cluster/commit/67d955d34c2cb45d82364836db38bb336cdeb923

A7 Allocate MtmDatabaseName in TopMemoryContext · postgrespro/postgres_cluster@67d955d · GitHub
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)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres_cluster/commit/67d955d34c2cb45d82364836db38bb336cdeb923

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy