Reinitialize sock to -1 after closing

Prevents bug where a closed socket is returned.
parent 320747e0
......@@ -593,6 +593,7 @@ static int startServer(openair0_device *device)
}
close(sock);
sock = -1;
}
freeaddrinfo(results);
......@@ -649,6 +650,7 @@ static int client_try_connect(const char *host, uint16_t port)
}
close(sock);
sock = -1;
}
freeaddrinfo(result);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment