From 21ed57092afe74db7cd10c5b724bf1567abc911d Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Wed, 13 Dec 2006 18:30:11 +0000 Subject: [PATCH] don't leak in the pool (heh heh) --- libtransmission/completion.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/libtransmission/completion.c b/libtransmission/completion.c index e442922ab..02e3a5d05 100644 --- a/libtransmission/completion.c +++ b/libtransmission/completion.c @@ -279,14 +279,17 @@ int tr_cpMostMissingBlockInPiece( tr_completion_t * cp, int piece, } } - if( poolSize < 1 ) + if( poolSize > 0 ) { - return -1; + ret = pool[0]; + *downloaders = min; + } + else + { + ret = -1; } - ret = pool[0]; free( pool ); - *downloaders = min; return ret; }