mirror of
https://github.com/postgres/postgres.git
synced 2025-07-18 17:42:25 +03: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:
@ -2565,10 +2565,13 @@ ClosePostmasterPorts(bool am_syslogger)
|
|||||||
* EXEC_BACKEND mode.
|
* EXEC_BACKEND mode.
|
||||||
*/
|
*/
|
||||||
#ifndef EXEC_BACKEND
|
#ifndef EXEC_BACKEND
|
||||||
for (int i = 0; i < NumListenSockets; i++)
|
if (ListenSockets)
|
||||||
StreamClose(ListenSockets[i]);
|
{
|
||||||
|
for (int i = 0; i < NumListenSockets; i++)
|
||||||
|
StreamClose(ListenSockets[i]);
|
||||||
|
pfree(ListenSockets);
|
||||||
|
}
|
||||||
NumListenSockets = 0;
|
NumListenSockets = 0;
|
||||||
pfree(ListenSockets);
|
|
||||||
ListenSockets = NULL;
|
ListenSockets = NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user