summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2003-01-27 00:23:49 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2003-01-27 00:23:49 +0000
commit938a562d22dbc713c85c50b163af1b370f42433e (patch)
tree316b6441fda77cd2a5c687323ed8d6c313404ca3 /src
parenta307ee1ccb0d832d0f6810ea0436536bcecb2297 (diff)
downloadpostgresql-938a562d22dbc713c85c50b163af1b370f42433e.tar.gz
Prevent core dump when die_horribly() is called with null AH pointer.
Problem reported and fixed by Oliver Elphick.
Diffstat (limited to 'src')
-rw-r--r--src/bin/pg_dump/pg_backup_archiver.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/bin/pg_dump/pg_backup_archiver.c b/src/bin/pg_dump/pg_backup_archiver.c
index dd6636bfad..e8d4a0a5a0 100644
--- a/src/bin/pg_dump/pg_backup_archiver.c
+++ b/src/bin/pg_dump/pg_backup_archiver.c
@@ -15,7 +15,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.62 2002/10/27 02:52:10 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.62.2.1 2003/01/27 00:23:49 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1282,14 +1282,15 @@ static void
_die_horribly(ArchiveHandle *AH, const char *modulename, const char *fmt, va_list ap)
{
_write_msg(modulename, fmt, ap);
- if (AH->public.verbose)
- write_msg(NULL, "*** aborted because of error\n");
- if (AH)
+ if (AH) {
+ if (AH->public.verbose)
+ write_msg(NULL, "*** aborted because of error\n");
if (AH->connection)
PQfinish(AH->connection);
- if (AH->blobConnection)
- PQfinish(AH->blobConnection);
+ if (AH->blobConnection)
+ PQfinish(AH->blobConnection);
+ }
exit(1);
}