From 6aaac706fab61bbb777f025d0a2bea3800efc3de Mon Sep 17 00:00:00 2001 From: irungentoo Date: Sun, 28 Jun 2015 22:15:29 -0400 Subject: Fixed bug. --- toxcore/net_crypto.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'toxcore') diff --git a/toxcore/net_crypto.c b/toxcore/net_crypto.c index be414799..60fe7021 100644 --- a/toxcore/net_crypto.c +++ b/toxcore/net_crypto.c @@ -700,13 +700,15 @@ static int handle_request_packet(Packets_Array *send_array, const uint8_t *data, n = 0; ++requested; } else { - uint64_t sent_time = send_array->buffer[num]->sent_time; + if (send_array->buffer[num]) { + uint64_t sent_time = send_array->buffer[num]->sent_time; - if (l_sent_time < sent_time) - l_sent_time = sent_time; + if (l_sent_time < sent_time) + l_sent_time = sent_time; - free(send_array->buffer[num]); - send_array->buffer[num] = NULL; + free(send_array->buffer[num]); + send_array->buffer[num] = NULL; + } } if (n == 255) { -- cgit v1.2.3