mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-02-23 19:39:53 +08:00
Fix crash on syslogger startup
When syslogger starts up, ListenSockets is still NULL. Don't try to
pfree it. Oversight in commit e29c464395
.
Reported-by: Michael Paquier
Discussion: https://www.postgresql.org/message-id/ZR-uNkgL7m60lWUe@paquier.xyz
This commit is contained in:
parent
fd4d93d269
commit
5da0a622e8
@ -2565,10 +2565,13 @@ ClosePostmasterPorts(bool am_syslogger)
|
||||
* EXEC_BACKEND mode.
|
||||
*/
|
||||
#ifndef EXEC_BACKEND
|
||||
for (int i = 0; i < NumListenSockets; i++)
|
||||
StreamClose(ListenSockets[i]);
|
||||
if (ListenSockets)
|
||||
{
|
||||
for (int i = 0; i < NumListenSockets; i++)
|
||||
StreamClose(ListenSockets[i]);
|
||||
pfree(ListenSockets);
|
||||
}
|
||||
NumListenSockets = 0;
|
||||
pfree(ListenSockets);
|
||||
ListenSockets = NULL;
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user