diff options
author | Bruce Momjian <bruce@momjian.us> | 1996-11-22 06:45:14 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 1996-11-22 06:45:14 +0000 |
commit | eda3771290b1c82943d1f5f3f7297884c052391e (patch) | |
tree | 46fc5b6c6892b0bb931ab50c75381a8877fbd263 /src | |
parent | 25fe3c709896a01abf6a2d851e646352f4f9d895 (diff) | |
download | postgresql-eda3771290b1c82943d1f5f3f7297884c052391e.tar.gz postgresql-eda3771290b1c82943d1f5f3f7297884c052391e.zip |
Fix for \g strdup error.
Diffstat (limited to 'src')
-rw-r--r-- | src/bin/psql/psql.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/bin/psql/psql.c b/src/bin/psql/psql.c index e7c13ba2a7f..8b22ecf70cb 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.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; } 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; break; case 'h': /* help */ |