diff --git a/command.c b/command.c index b34e6ceaeb..47d032125f 100644 --- a/command.c +++ b/command.c @@ -27,6 +27,11 @@ #include #include +#ifndef _WIN32 +#include +#include +#endif + #define DEFAULT_NETWORK_CMD_PORT 55355 #define STDIN_BUF_SIZE 4096 @@ -114,7 +119,9 @@ rarch_cmd_t *rarch_cmd_new(bool stdin_enable, bool network_enable, uint16_t port (void)stdin_enable; #endif +#ifdef HAVE_NETWORK_CMD freeaddrinfo(res); +#endif return handle; error: @@ -128,8 +135,10 @@ error: void rarch_cmd_free(rarch_cmd_t *handle) { +#ifdef HAVE_NETWORK_CMD if (handle->net_fd >= 0) close(handle->net_fd); +#endif free(handle); }