From: Thomas Pornin Date: Thu, 3 Jan 2019 13:31:38 +0000 (+0100) Subject: Fixed fd leak in test code. X-Git-Url: https://bearssl.org/gitweb//home/git/?a=commitdiff_plain;h=08eb07825be067729dff343de2d9a0c13252b415;p=BearSSL Fixed fd leak in test code. --- diff --git a/src/rand/sysrng.c b/src/rand/sysrng.c index bec06be..5ddbcbe 100644 --- a/src/rand/sysrng.c +++ b/src/rand/sysrng.c @@ -161,9 +161,10 @@ br_prng_seeder_system(const char **name) *name = "win32"; } return &seeder_win32; -#endif +#else if (name != NULL) { *name = "none"; } return 0; +#endif } diff --git a/tools/server.c b/tools/server.c index 9d296d2..a97de35 100644 --- a/tools/server.c +++ b/tools/server.c @@ -1218,6 +1218,13 @@ server_exit: closesocket(fd); #else close(fd); +#endif + } + if (server_fd != INVALID_SOCKET) { +#ifdef _WIN32 + closesocket(server_fd); +#else + close(server_fd); #endif } return retcode;