fix(PISerial): close fd when probe read fails in availableDevicesInfo

When the non-blocking probe read returned EIO, the loop continued
without closing the file descriptor, leaking one fd per rejected
port on each call.
This commit is contained in:
2026-08-06 17:01:30 +03:00
committed by andrey
parent c8ad8ecaf4
commit 9e280ef976
+5
View File
@@ -1292,6 +1292,11 @@ PIVector<PISerial::DeviceInfo> PISerial::availableDevicesInfo(bool test) {
if (!rok) {
ret.remove(i);
--i;
#ifdef WINDOWS
CloseHandle(hComm);
#else
::close(fd);
#endif
continue;
}
#ifdef WINDOWS