servers: fix HANDLE leak in UWP builds

Also: shorten code.

Reported by Copilot
Bug: https://github.com/curl/curl/pull/22487#pullrequestreview-4863399903

Closes #22489
This commit is contained in:
Viktor Szakats 2026-08-05 12:42:15 +02:00
parent 90325ff044
commit 7babac8690
No known key found for this signature in database

View file

@ -696,12 +696,9 @@ void restore_signal_handlers(bool keep_sigalrm)
}
}
}
if(exit_event) {
if(CloseHandle(exit_event)) {
exit_event = NULL;
}
}
#endif
if(exit_event && CloseHandle(exit_event))
exit_event = NULL;
#endif
}