Commit 4b833d08 authored by Tom Lane's avatar Tom Lane

Prevent core dump when die_horribly() is called with null AH pointer.

Problem reported and fixed by Oliver Elphick.
parent 4dc2bcee
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.65 2003/01/13 04:28:55 inoue Exp $ * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_backup_archiver.c,v 1.66 2003/01/27 00:23:38 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -1379,14 +1379,15 @@ static void ...@@ -1379,14 +1379,15 @@ static void
_die_horribly(ArchiveHandle *AH, const char *modulename, const char *fmt, va_list ap) _die_horribly(ArchiveHandle *AH, const char *modulename, const char *fmt, va_list ap)
{ {
_write_msg(modulename, fmt, ap); _write_msg(modulename, fmt, ap);
if (AH) {
if (AH->public.verbose) if (AH->public.verbose)
write_msg(NULL, "*** aborted because of error\n"); write_msg(NULL, "*** aborted because of error\n");
if (AH)
if (AH->connection) if (AH->connection)
PQfinish(AH->connection); PQfinish(AH->connection);
if (AH->blobConnection) if (AH->blobConnection)
PQfinish(AH->blobConnection); PQfinish(AH->blobConnection);
}
exit(1); exit(1);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment