diff options
author | Magnus Hagander <magnus@hagander.net> | 2010-04-13 08:16:09 +0000 |
---|---|---|
committer | Magnus Hagander <magnus@hagander.net> | 2010-04-13 08:16:09 +0000 |
commit | a95d15ff5dd58ed1d8889e2476748a3ea49a9bf1 (patch) | |
tree | 451e901b0b1a22bd505f9f14a1a0087f2a15f6b4 /src | |
parent | 325e9cb3a06b6e35968ad8eee4a606c64519fac9 (diff) | |
download | postgresql-a95d15ff5dd58ed1d8889e2476748a3ea49a9bf1.tar.gz postgresql-a95d15ff5dd58ed1d8889e2476748a3ea49a9bf1.zip |
Only try to do a graceful disconnect if we've successfully loaded the
shared library with the disconnect function in it. Fixes segmentation
fault reported by Jeff Davis.
Fujii Masao
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/replication/walreceiver.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/backend/replication/walreceiver.c b/src/backend/replication/walreceiver.c index 4dedcdc8b2c..090111bb112 100644 --- a/src/backend/replication/walreceiver.c +++ b/src/backend/replication/walreceiver.c @@ -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 */ |