Imported Upstream version 1.38
[platform/upstream/connman.git] / gweb / gweb.c
index 393afe0..12fcb1d 100644 (file)
@@ -1274,7 +1274,8 @@ static bool is_ip_address(const char *host)
        addr = NULL;
 
        result = getaddrinfo(host, NULL, &hints, &addr);
-       freeaddrinfo(addr);
+       if(!result)
+               freeaddrinfo(addr);
 
        return result == 0;
 }