From a588eaddc89f4aa21325e7ff07c69b3f15d23afc Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Mon, 1 Dec 2008 05:57:59 +0000 Subject: [PATCH] (libT) fix a small pex memory leak --- libtransmission/peer-msgs.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libtransmission/peer-msgs.c b/libtransmission/peer-msgs.c index 966dc08a2..c06cbd744 100644 --- a/libtransmission/peer-msgs.c +++ b/libtransmission/peer-msgs.c @@ -1791,7 +1791,11 @@ sendPex( tr_peermsgs * msgs ) "pex: old peer count %d, new peer count %d, added %d, removed %d", msgs->pexCount, newCount, diffs.addedCount, diffs.droppedCount ); - if( diffs.addedCount || diffs.droppedCount ) + if( !diffs.addedCount && !diffs.droppedCount ) + { + tr_free( diffs.elements ); + } + else { int i; tr_benc val;