]> granicus.if.org Git - postgresql/commitdiff
Prevent core dump when die_horribly() is called with null AH pointer.
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 27 Jan 2003 00:23:49 +0000 (00:23 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 27 Jan 2003 00:23:49 +0000 (00:23 +0000)
Problem reported and fixed by Oliver Elphick.

src/bin/pg_dump/pg_backup_archiver.c

index dd6636bfad968ba6e70a52609db0556a8309da9b..e8d4a0a5a067d08c76cc20ff7328b445c5e97c97 100644 (file)
@@ -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);
 }