From b7b84bdec4c94c459ea67b44b829c495d6144312 Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Sun, 7 Apr 2024 00:06:27 +0200 Subject: Number of reported removed peers was too high, correct it by size of peer --- ot_vector.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ot_vector.c') diff --git a/ot_vector.c b/ot_vector.c index 36b326a..479e832 100644 --- a/ot_vector.c +++ b/ot_vector.c @@ -157,8 +157,8 @@ void vector_remove_torrent( ot_vector *vector, ot_torrent *match ) { /* If this is being called after a unsuccessful malloc() for peer_list in add_peer_to_torrent, match->peer_list actually might be NULL */ - if( match->peer_list6) free_peerlist( match->peer_list6 ); - if( match->peer_list4) free_peerlist( match->peer_list4 ); + free_peerlist( match->peer_list6 ); + free_peerlist( match->peer_list4 ); memmove( match, match + 1, sizeof(ot_torrent) * ( end - match - 1 ) ); if( ( --vector->size * OT_VECTOR_SHRINK_THRESH < vector->space ) && ( vector->space >= OT_VECTOR_SHRINK_RATIO * OT_VECTOR_MIN_MEMBERS ) ) { -- cgit v1.2.3