diff options
-rw-r--r-- | toxcore/net_crypto.c | 12 |
1 files changed, 7 insertions, 5 deletions
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, | |||
700 | n = 0; | 700 | n = 0; |
701 | ++requested; | 701 | ++requested; |
702 | } else { | 702 | } else { |
703 | uint64_t sent_time = send_array->buffer[num]->sent_time; | 703 | if (send_array->buffer[num]) { |
704 | uint64_t sent_time = send_array->buffer[num]->sent_time; | ||
704 | 705 | ||
705 | if (l_sent_time < sent_time) | 706 | if (l_sent_time < sent_time) |
706 | l_sent_time = sent_time; | 707 | l_sent_time = sent_time; |
707 | 708 | ||
708 | free(send_array->buffer[num]); | 709 | free(send_array->buffer[num]); |
709 | send_array->buffer[num] = NULL; | 710 | send_array->buffer[num] = NULL; |
711 | } | ||
710 | } | 712 | } |
711 | 713 | ||
712 | if (n == 255) { | 714 | if (n == 255) { |