aboutsummaryrefslogtreecommitdiff
path: root/net/net.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/net.c')
-rw-r--r--net/net.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/net.c b/net/net.c
index 4dc79f2..0a2dc98 100644
--- a/net/net.c
+++ b/net/net.c
@@ -117,8 +117,8 @@ int net_client_recv (net_client *c, char buffer[]) {
void net_client_close (net_client *c) {
if (c->socket != NULL) p_socket_close (c->socket, NULL);
- p_socket_address_free (c->addr_server);
- p_socket_free (c->socket);
+ if (c->addr_server != NULL) p_socket_address_free (c->addr_server);
+ if (c->socket != NULL) p_socket_free (c->socket);
}