mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-01-24 18:55:04 +08:00
Prevent psql optarg free-ing
This commit is contained in:
parent
741b497f21
commit
5eb4fadeaa
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user