summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>1997-07-14 22:08:56 +0000
committerBruce Momjian <bruce@momjian.us>1997-07-14 22:08:56 +0000
commit5eb4fadeaa414be90465faac2b6bd0d31814df32 (patch)
treeb11e80c354c80f60c50049c58a2affdb9a6e6beb
parent741b497f218949cb5837054b115c82b546388252 (diff)
downloadpostgresql-5eb4fadeaa414be90465faac2b6bd0d31814df32.tar.gz
Prevent psql optarg free-ing
-rw-r--r--src/bin/psql/psql.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/bin/psql/psql.c b/src/bin/psql/psql.c
index 1782a07fe8..469d3ea259 100644
--- a/src/bin/psql/psql.c
+++ b/src/bin/psql/psql.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.76 1997/06/29 17:29:28 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.77 1997/07/14 22:08:56 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1641,7 +1641,7 @@ main(int argc, char **argv)
fe_setauthsvc(optarg, errbuf);
break;
case 'c':
- singleQuery = optarg;
+ singleQuery = strdup(optarg);
if (singleQuery[0] == '\\') {
singleSlashCmd = 1;
}
@@ -1656,7 +1656,7 @@ main(int argc, char **argv)
qfilename = optarg;
break;
case 'F':
- settings.opt.fieldSep = optarg;
+ settings.opt.fieldSep = strdup(optarg);
break;
case 'l':
listDatabases = 1;
@@ -1689,7 +1689,7 @@ main(int argc, char **argv)
settings.opt.header = 0;
break;
case 'T':
- settings.opt.tableOpt = optarg;
+ settings.opt.tableOpt = strdup(optarg);
break;
case 'u':
settings.getPassword = 1;
@@ -1759,8 +1759,7 @@ main(int argc, char **argv)
sprintf(line, "\\i %s", qfilename);
}
HandleSlashCmds(&settings, line, "");
- if (!singleSlashCmd) free (line); /* PURIFY */
-
+ free (line); /* PURIFY */
} else {
if (singleQuery) {
bool success; /* The query succeeded at the backend */