X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=src%2Fserver.c;h=7f84e5aaffd5f5a68f402bacc055528986586d4b;hb=63561f9937d11b1371a2de2511b903035818b42f;hp=1dda8b4545edfe6481557873588365b878fe00bb;hpb=4fe2472f5302b74df5dbb43822711487f1fd9851;p=catta diff --git a/src/server.c b/src/server.c index 1dda8b4..7f84e5a 100644 --- a/src/server.c +++ b/src/server.c @@ -1381,12 +1381,14 @@ CattaServer *catta_server_new(const CattaPoll *poll_api, const CattaServerConfig else catta_server_config_init(&s->config); + winsock_init(); // on Windows, call WSAStartup; no-op on other platforms if ((e = setup_sockets(s)) < 0) { if (error) *error = e; catta_server_config_free(&s->config); catta_free(s); + winsock_exit(); return NULL; } @@ -1533,6 +1535,7 @@ void catta_server_free(CattaServer* s) { catta_server_config_free(&s->config); catta_free(s); + winsock_exit(); // on Windows, call WSACleanup(); no-op on other platforms } const char* catta_server_get_domain_name(CattaServer *s) {