src/net_socket.c bind_to_address(): Use after free in error path.
authorSven-Haegar Koch <haegar@sdinet.de>
Sun, 29 May 2011 19:35:31 +0000 (21:35 +0200)
committerGuus Sliepen <guus@tinc-vpn.org>
Sun, 29 May 2011 20:05:04 +0000 (22:05 +0200)
src/net_socket.c

index 4012096..db7fb5c 100644 (file)
@@ -137,9 +137,9 @@ static bool bind_to_address(connection_t *c) {
        status = getaddrinfo(node, /* service = */ NULL,
                        &ai_hints, &ai_list);
        if(status) {
-               free(node);
                logger(LOG_WARNING, "Error looking up %s port %s: %s",
                                node, "any", gai_strerror(status));
+               free(node);
                return false;
        }
        assert(ai_list != NULL);