Reinitialize sock to -1 after closing

Prevents bug where a closed socket is returned.
This commit is contained in:
Ghislain Bourgeois
2024-10-02 10:34:27 -04:00
parent 320747e0b0
commit 6344fce6e4
+2
View File
@@ -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);