提交 096934e5 编写于 作者: J Jimmy Yih

Bring back strdup on optline in pg_ctl read_post_opts

The strdups were removed in a recent 8.4 postgres merge commit
fa287d01. Without them, pg_ctl restart will usually fail as the memory
is freed for optline. Bring them back similar to how it was fixed in
an earlier commit.

Reference commit by Daniel Gustafsson:
https://github.com/greenplum-db/gpdb/commit/627ba5d8d83caa133ed1d8c9e13570bd162933bf
上级 e9ee2a02
......@@ -697,10 +697,10 @@ read_post_opts(void)
if ((arg1 = strstr(optline, " \"")) != NULL)
{
*arg1 = '\0'; /* terminate so we get only program name */
post_opts = arg1 + 1; /* point past whitespace */
post_opts = strdup(arg1 + 1); /* point past whitespace */
}
if (postgres_path == NULL)
postgres_path = optline;
postgres_path = strdup(optline);
}
/* Free the results of readfile. */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册