Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 5da0a62

Browse filesBrowse 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
Copy full SHA for 5da0a62

File tree

1 file changed

+6
-3
lines changed
Filter options

1 file changed

+6
-3
lines changed

‎src/backend/postmaster/postmaster.c

Copy file name to clipboardExpand all lines: src/backend/postmaster/postmaster.c
+6-3Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.