From f9cc51f0d396456abea16264c7c256284562a619 Mon Sep 17 00:00:00 2001 From: Jordan Lee Date: Wed, 14 Dec 2011 05:44:15 +0000 Subject: [PATCH] (trunk libT) fix a minor memory leak in the bencode regression tests. Found by llvm's static analyzer. This is a minor issue since the leak is in an automated test rather than in shipping code, but it's still better to fix it. --- libtransmission/bencode-test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libtransmission/bencode-test.c b/libtransmission/bencode-test.c index 4509b359e..f7acdadab 100644 --- a/libtransmission/bencode-test.c +++ b/libtransmission/bencode-test.c @@ -319,8 +319,8 @@ testJSONSnippet( const char * benc_str, const char * expected ) { tr_benc top; - struct evbuffer * buf = evbuffer_new( ); char * serialized; + struct evbuffer * buf; tr_bencLoad( benc_str, strlen( benc_str ), &top, NULL ); buf = tr_bencToBuf( &top, TR_FMT_JSON );