diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2003-01-27 00:23:38 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2003-01-27 00:23:38 +0000 |
commit | 4b833d080b56e69127567478298d3dbbf28a58b8 (patch) | |
tree | fa0e7003a9e8b0565b4e1e1cfd8859fc35a80616 | |
parent | 4dc2bceef4706f7786d54a5d0dcf88fa5ed6780b (diff) | |
download | postgresql-4b833d080b56e69127567478298d3dbbf28a58b8.tar.gz postgresql-4b833d080b56e69127567478298d3dbbf28a58b8.zip |
Prevent core dump when die_horribly() is called with null AH pointer.
Problem reported and fixed by Oliver Elphick.
-rw-r--r-- | src/bin/pg_dump/pg_backup_archiver.c | 13 |
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 2b38141db83..52202c7df56 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.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 _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); } |