pgpool2.git / summary / log / commit / refs

commit    6b28f44f8077ec92276e1e5bd03517bd8b8a0b72
Author:   Tatsuo Ishii <ishii@postgresql.org>
Date:     Sat Jun 14 07:15:59 2025 +0000

    Fix resource leak in hearbeat receiver process.
    
    Pointed out by Coverity.
    Backpatch-through: v4.6


src/watchdog/wd_heartbeat.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/watchdog/wd_heartbeat.c b/src/watchdog/wd_heartbeat.c index 561cdfccf..28a01d290 100644 --- a/src/watchdog/wd_heartbeat.c +++ b/src/watchdog/wd_heartbeat.c @@ -357,6 +357,7 @@ wd_create_hb_recv_socket(WdHbIf * hb_if) ereport(LOG, (errmsg("failed to create watchdog heartbeat receive socket."), errdetail("setsockopt(SO_BINDTODEVICE) requires root privilege"))); + close(sock); continue; } } @@ -364,6 +365,7 @@ wd_create_hb_recv_socket(WdHbIf * hb_if) ereport(LOG, (errmsg("failed to create watchdog heartbeat receive socket"), errdetail("setsockopt(SO_BINDTODEVICE) is not available on this platform"))); + close(sock); continue; #endif } [parent: bbe93d86b304]