mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-10-03 16:36:53 +02:00
Fix for \g strdup error.
This commit is contained in:
parent
25fe3c7098
commit
eda3771290
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $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 $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -1099,7 +1099,12 @@ HandleSlashCmds(PsqlSettings * settings,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'g': /* \g means send query */
|
case 'g': /* \g means send query */
|
||||||
settings->gfname = strdup(optarg);
|
if (!optarg)
|
||||||
|
settings->gfname = NULL;
|
||||||
|
else if (!(settings->gfname = strdup(optarg))) {
|
||||||
|
perror("malloc");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
status = 0;
|
status = 0;
|
||||||
break;
|
break;
|
||||||
case 'h': /* help */
|
case 'h': /* help */
|
||||||
|
Loading…
Reference in New Issue
Block a user