]> granicus.if.org Git - postgresql/commitdiff
Only try to do a graceful disconnect if we've successfully loaded the
authorMagnus Hagander <magnus@hagander.net>
Tue, 13 Apr 2010 08:16:09 +0000 (08:16 +0000)
committerMagnus Hagander <magnus@hagander.net>
Tue, 13 Apr 2010 08:16:09 +0000 (08:16 +0000)
shared library with the disconnect function in it. Fixes segmentation
fault reported by Jeff Davis.

Fujii Masao

src/backend/replication/walreceiver.c

index 4dedcdc8b2c04263be2d67c3506fe09ee85f84e9..090111bb1126d6ad48f582d91e7b263885163192 100644 (file)
@@ -29,7 +29,7 @@
  *
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/replication/walreceiver.c,v 1.7 2010/03/21 00:17:58 petere Exp $
+ *       $PostgreSQL: pgsql/src/backend/replication/walreceiver.c,v 1.8 2010/04/13 08:16:09 mha Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -330,7 +330,8 @@ WalRcvDie(int code, Datum arg)
        SpinLockRelease(&walrcv->mutex);
 
        /* Terminate the connection gracefully. */
-       walrcv_disconnect();
+       if (walrcv_disconnect != NULL)
+               walrcv_disconnect();
 }
 
 /* SIGHUP: set flag to re-read config file at next convenient time */