Commit dd917bb7 authored by Stephen Frost's avatar Stephen Frost

Allocate fresh memory for post_opts/exec_path

Instead of having read_post_opts() depend on the memory allocated for
the config file (which is now getting free'd), pg_strdup() for
post_opts and exec_path (similar to how it's being done elsewhere).

Noted by Thom Brown.
parent 956685f8
...@@ -730,10 +730,10 @@ read_post_opts(void) ...@@ -730,10 +730,10 @@ read_post_opts(void)
{ {
*arg1 = '\0'; /* terminate so we get only program *arg1 = '\0'; /* terminate so we get only program
* name */ * name */
post_opts = arg1 + 1; /* point past whitespace */ post_opts = pg_strdup(arg1 + 1); /* point past whitespace */
} }
if (exec_path == NULL) if (exec_path == NULL)
exec_path = optline; exec_path = pg_strdup(optline);
} }
/* Free the results of readfile. */ /* Free the results of readfile. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment