Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit dd917bb

Browse files
committed
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.
1 parent 956685f commit dd917bb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/bin/pg_ctl/pg_ctl.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -730,10 +730,10 @@ read_post_opts(void)
730730
{
731731
*arg1 = '\0'; /* terminate so we get only program
732732
* name */
733-
post_opts = arg1 + 1; /* point past whitespace */
733+
post_opts = pg_strdup(arg1 + 1); /* point past whitespace */
734734
}
735735
if (exec_path == NULL)
736-
exec_path = optline;
736+
exec_path = pg_strdup(optline);
737737
}
738738

739739
/* Free the results of readfile. */

0 commit comments

Comments
 (0)