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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy