From 938a562d22dbc713c85c50b163af1b370f42433e Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Mon, 27 Jan 2003 00:23:49 +0000 Subject: [PATCH] Prevent core dump when die_horribly() is called with null AH pointer. Problem reported and fixed by Oliver Elphick. --- src/bin/pg_dump/pg_backup_archiver.c | 13 +++++++------ 1 file 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); } -- 2.50.0