Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
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

+6-3
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)