We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 25fe3c7 commit eda3771Copy full SHA for eda3771
src/bin/psql/psql.c
@@ -7,7 +7,7 @@
7
*
8
9
* IDENTIFICATION
10
- * $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.31 1996/11/22 04:43:48 bryanh Exp $
+ * $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.32 1996/11/22 06:45:14 momjian Exp $
11
12
*-------------------------------------------------------------------------
13
*/
@@ -1099,7 +1099,12 @@ HandleSlashCmds(PsqlSettings * settings,
1099
break;
1100
}
1101
case 'g': /* \g means send query */
1102
- settings->gfname = strdup(optarg);
+ if (!optarg)
1103
+ settings->gfname = NULL;
1104
+ else if (!(settings->gfname = strdup(optarg))) {
1105
+ perror("malloc");
1106
+ exit(1);
1107
+ }
1108
status = 0;
1109
1110
case 'h': /* help */
0 commit comments