8000 Only try to do a graceful disconnect if we've successfully loaded the · xrg/postgres@c4faeeb · GitHub
[go: up one dir, main page]

Skip to content

Commit c4faeeb

Browse files
committed
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
1 parent 8181301 commit c4faeeb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/backend/replication/walreceiver.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,8 @@ WalRcvDie(int code, Datum arg)
330330
SpinLockRelease(&walrcv->mutex);
331331

332332
/* Terminate the connection gracefully. */
333-
walrcv_disconnect();
333+
if (walrcv_disconnect != NULL)
334+
walrcv_disconnect();
334335
}
335336

336337
/* SIGHUP: set flag to re-read config file at next convenient time */

0 commit comments

Comments
 (0)
0