fix(PIClientServer): delete PIEthernet when client_factory returns nullptr

When the custom client_factory() returned nullptr, the incoming
PIEthernet pointer was leaked. Matches existing pattern used in the
max_clients overflow branch.
This commit is contained in:
2026-08-05 17:39:35 +03:00
parent e89ae88f3a
commit 6c5c4b73e0
@@ -37,6 +37,7 @@ PIClientServer::Server::Server() {
auto sc = client_factory(); auto sc = client_factory();
if (!sc) { if (!sc) {
piCout << "ClientFactory returns nullptr!"_tr("PIClientServer"); piCout << "ClientFactory returns nullptr!"_tr("PIClientServer");
delete c;
return; return;
} }
sc->createForServer(this, c); sc->createForServer(this, c);