diff options
Diffstat (limited to 'toxcore/TCP_client.c')
-rw-r--r-- | toxcore/TCP_client.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/toxcore/TCP_client.c b/toxcore/TCP_client.c index 9091900f..5abb7232 100644 --- a/toxcore/TCP_client.c +++ b/toxcore/TCP_client.c | |||
@@ -604,6 +604,9 @@ void do_TCP_connection(TCP_Client_Connection *TCP_connection) | |||
604 | */ | 604 | */ |
605 | void kill_TCP_connection(TCP_Client_Connection *TCP_connection) | 605 | void kill_TCP_connection(TCP_Client_Connection *TCP_connection) |
606 | { | 606 | { |
607 | if (TCP_connection == NULL) | ||
608 | return; | ||
609 | |||
607 | kill_sock(TCP_connection->sock); | 610 | kill_sock(TCP_connection->sock); |
608 | memset(TCP_connection, 0, sizeof(TCP_Client_Connection)); | 611 | memset(TCP_connection, 0, sizeof(TCP_Client_Connection)); |
609 | free(TCP_connection); | 612 | free(TCP_connection); |