httpserver: make sure that socket is freed even if StartServerSocket raised an exception

This commit is contained in:
Ondrej Pokorny 2023-04-29 13:40:27 +02:00 committed by Pierre Muller
parent 1ac8d5d221
commit eaf4cffad8

View File

@ -1464,8 +1464,11 @@ begin
SetupConnectionHandler; SetupConnectionHandler;
CreateServerSocket; CreateServerSocket;
SetupSocket; SetupSocket;
StartServerSocket; try
FreeServerSocket; StartServerSocket;
finally
FreeServerSocket;
end
end end
else else
StopServerSocket; StopServerSocket;