From 3f820c6fb84931755161f8d109d43226a3d6d45c Mon Sep 17 00:00:00 2001 From: Max Lv Date: Tue, 7 Mar 2017 10:33:49 +0800 Subject: [PATCH] Fix #1334 --- src/udprelay.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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; }