summaryrefslogtreecommitdiff
path: root/trackerlogic.c
diff options
context:
space:
mode:
Diffstat (limited to 'trackerlogic.c')
-rw-r--r--trackerlogic.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/trackerlogic.c b/trackerlogic.c
index 5e32f13..11113d2 100644
--- a/trackerlogic.c
+++ b/trackerlogic.c
@@ -21,6 +21,7 @@
21 21
22/* Opentracker */ 22/* Opentracker */
23#include "trackerlogic.h" 23#include "trackerlogic.h"
24#include "ot_vector.h"
24#include "ot_mutex.h" 25#include "ot_mutex.h"
25#include "ot_stats.h" 26#include "ot_stats.h"
26#include "ot_clean.h" 27#include "ot_clean.h"
@@ -34,13 +35,10 @@ size_t return_peers_for_torrent( struct ot_workstruct * ws, ot_torrent *torrent,
34 35
35void free_peerlist( ot_peerlist *peer_list ) { 36void free_peerlist( ot_peerlist *peer_list ) {
36 if( peer_list->peers.data ) { 37 if( peer_list->peers.data ) {
37 if( OT_PEERLIST_HASBUCKETS( peer_list ) ) { 38 if( OT_PEERLIST_HASBUCKETS( peer_list ) )
38 ot_vector *bucket_list = (ot_vector*)(peer_list->peers.data); 39 vector_clean_list( (ot_vector*)peer_list->peers.data, peer_list->peers.size );
39 40 else
40 while( peer_list->peers.size-- ) 41 free( peer_list->peers.data );
41 free( bucket_list++->data );
42 }
43 free( peer_list->peers.data );
44 } 42 }
45 free( peer_list ); 43 free( peer_list );
46} 44}