mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-12-27 08:39:28 +08:00
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.
This commit is contained in:
parent
956685f82b
commit
dd917bb793
@ -730,10 +730,10 @@ read_post_opts(void)
|
||||
{
|
||||
*arg1 = '\0'; /* terminate so we get only program
|
||||
* name */
|
||||
post_opts = arg1 + 1; /* point past whitespace */
|
||||
post_opts = pg_strdup(arg1 + 1); /* point past whitespace */
|
||||
}
|
||||
if (exec_path == NULL)
|
||||
exec_path = optline;
|
||||
exec_path = pg_strdup(optline);
|
||||
}
|
||||
|
||||
/* Free the results of readfile. */
|
||||
|
Loading…
Reference in New Issue
Block a user