aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/backend/utils/init/postinit.c11
-rw-r--r--src/include/miscadmin.h2
2 files changed, 7 insertions, 6 deletions
diff --git a/src/backend/utils/init/postinit.c b/src/backend/utils/init/postinit.c
index 0e7b5fad2dd..063b0653b49 100644
--- a/src/backend/utils/init/postinit.c
+++ b/src/backend/utils/init/postinit.c
@@ -418,7 +418,7 @@ InitCommunication(void)
* backslashes, with \\ representing a literal backslash.
*/
void
-pg_split_opts(char **argv, int *argcp, char *optstr)
+pg_split_opts(char **argv, int *argcp, const char *optstr)
{
StringInfoData s;
@@ -438,8 +438,8 @@ pg_split_opts(char **argv, int *argcp, char *optstr)
break;
/*
- * Parse a single option + value, stopping at the first space, unless
- * it's escaped.
+ * Parse a single option, stopping at the first space, unless it's
+ * escaped.
*/
while (*optstr)
{
@@ -457,10 +457,11 @@ pg_split_opts(char **argv, int *argcp, char *optstr)
optstr++;
}
- /* now store the option */
+ /* now store the option in the next argv[] position */
argv[(*argcp)++] = pstrdup(s.data);
}
- resetStringInfo(&s);
+
+ pfree(s.data);
}
/*
diff --git a/src/include/miscadmin.h b/src/include/miscadmin.h
index 71aa505e17d..b5391673609 100644
--- a/src/include/miscadmin.h
+++ b/src/include/miscadmin.h
@@ -408,7 +408,7 @@ extern AuxProcType MyAuxProcType;
*****************************************************************************/
/* in utils/init/postinit.c */
-extern void pg_split_opts(char **argv, int *argcp, char *optstr);
+extern void pg_split_opts(char **argv, int *argcp, const char *optstr);
extern void InitializeMaxBackends(void);
extern void InitPostgres(const char *in_dbname, Oid dboid, const char *username,
Oid useroid, char *out_dbname);