summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorerdgeist <>2007-02-01 17:01:03 +0000
committererdgeist <>2007-02-01 17:01:03 +0000
commit4569b9ffdf9507b4444f70fcb8144fa0ba6dc9fe (patch)
treefd290dfa210057749ec19e899e2e9b395774cec9
parent401d0759ab6c2a90cbce5fc63c92c3bc802e3640 (diff)
release memory for empty peer pools
-rw-r--r--trackerlogic.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/trackerlogic.c b/trackerlogic.c
index 5ff448f..26d50f4 100644
--- a/trackerlogic.c
+++ b/trackerlogic.c
@@ -99,6 +99,12 @@ static int vector_remove_peer( ot_vector *vector, ot_peer *peer ) {
99 vector->space /= OT_VECTOR_SHRINK_RATIO; 99 vector->space /= OT_VECTOR_SHRINK_RATIO;
100 vector->data = realloc( vector->data, vector->space * sizeof( ot_peer ) ); 100 vector->data = realloc( vector->data, vector->space * sizeof( ot_peer ) );
101 } 101 }
102 if( !vector->size ) {
103 /* for peer pools its safe to let them go,
104 in 999 of 1000 this happens in older pools, that won't ever grow again */
105 free( vector->data );
106 vector->space = 0;
107 }
102 return exactmatch; 108 return exactmatch;
103} 109}
104 110