Skip to content

Commit 94158ef

Browse files
committed
Fix bug in MtmSplitConnStrs
1 parent 484f10c commit 94158ef

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

contrib/mmts/multimaster.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1208,7 +1208,8 @@ void MtmUpdateNodeConnStr(int nodeId, char const* connStr)
12081208
static void MtmSplitConnStrs(void)
12091209
{
12101210
int i;
1211-
char* connStr = strdup(MtmConnStrs);
1211+
char* copy = strdup(MtmConnStrs);
1212+
char* connStr = copy;
12121213
char* connStrEnd = connStr + strlen(connStr);
12131214

12141215
for (i = 0; connStr < connStrEnd; i++) {
@@ -1237,7 +1238,7 @@ static void MtmSplitConnStrs(void)
12371238
}
12381239
connStr = p + 1;
12391240
}
1240-
free(connStr);
1241+
free(copy);
12411242
if (i < 2) {
12421243
elog(ERROR, "Multimaster should have at least two nodes");
12431244
}

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