Content-Length: 272858 | pFad | http://github.com/postgrespro/postgres/commit/5da0a622e88907722ce456d30dbf0565ed7a222b

10 Fix crash on syslogger startup · postgrespro/postgres@5da0a62 · GitHub
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)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres/commit/5da0a622e88907722ce456d30dbf0565ed7a222b

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy