diff --git a/src/udprelay.c b/src/udprelay.c index 3f64558f..98334f11 100644 --- a/src/udprelay.c +++ b/src/udprelay.c @@ -459,13 +459,14 @@ create_server_socket(const char *host, const char *port) close(server_sock); } + if (result) + freeaddrinfo(result); + if (rp == NULL) { LOGE("[udp] cannot bind"); return -1; } - freeaddrinfo(result); - return server_sock; }