Skip to content

Commit 5da0a62

Browse files
committed
Fix crash on syslogger startup
When syslogger starts up, ListenSockets is still NULL. Don't try to pfree it. Oversight in commit e29c464. Reported-by: Michael Paquier Discussion: https://www.postgresql.org/message-id/ZR-uNkgL7m60lWUe@paquier.xyz
1 parent fd4d93d commit 5da0a62

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/backend/postmaster/postmaster.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2565,10 +2565,13 @@ ClosePostmasterPorts(bool am_syslogger)
25652565
* EXEC_BACKEND mode.
25662566
*/
25672567
#ifndef EXEC_BACKEND
2568-
for (int i = 0; i < NumListenSockets; i++)
2569-
StreamClose(ListenSockets[i]);
2568+
if (ListenSockets)
2569+
{
2570+
for (int i = 0; i < NumListenSockets; i++)
2571+
StreamClose(ListenSockets[i]);
2572+
pfree(ListenSockets);
2573+
}
25702574
NumListenSockets = 0;
2571-
pfree(ListenSockets);
25722575
ListenSockets = NULL;
25732576
#endif
25742577

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy