diff options
author | Stephen Frost <sfrost@snowman.net> | 2014-03-05 08:50:12 -0500 |
---|---|---|
committer | Stephen Frost <sfrost@snowman.net> | 2014-03-05 08:50:12 -0500 |
commit | dd917bb793b27f8c7616f0e64f9a119e8d98eb24 (patch) | |
tree | 9920705d48bc8f72c867c2a0d1ecb3019f343932 /src | |
parent | 956685f82b6983ff17e6a39bd386b11f554715a8 (diff) | |
download | postgresql-dd917bb793b27f8c7616f0e64f9a119e8d98eb24.tar.gz postgresql-dd917bb793b27f8c7616f0e64f9a119e8d98eb24.zip |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/bin/pg_ctl/pg_ctl.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/bin/pg_ctl/pg_ctl.c b/src/bin/pg_ctl/pg_ctl.c index ff84498a005..0dbaa6e27fe 100644 --- a/src/bin/pg_ctl/pg_ctl.c +++ b/src/bin/pg_ctl/pg_ctl.c @@ -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. */ |