From: Charles Kerr Date: Wed, 10 Feb 2010 05:27:14 +0000 (+0000) Subject: (trunk libT) Yippie, plug a small memory leak reported by valgrind! X-Git-Tag: 1.90~67 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9fffb2be35db3611edc19844a5b71108aed6441a;p=transmission (trunk libT) Yippie, plug a small memory leak reported by valgrind! --- diff --git a/libtransmission/torrent-magnet.c b/libtransmission/torrent-magnet.c index 33d821126..31fd573e7 100644 --- a/libtransmission/torrent-magnet.c +++ b/libtransmission/torrent-magnet.c @@ -200,14 +200,12 @@ tr_torrentSetMetadataPiece( tr_torrent * tor, int piece, const void * data, in if( !tr_bencLoadFile( &newMetainfo, TR_FMT_BENC, path ) ) { tr_bool hasInfo; - tr_benc * tmp; /* remove any old .torrent and .resume files */ remove( path ); tr_torrentRemoveResume( tor ); dbgmsg( tor, "Saving completed metadata to \"%s\"", path ); - assert( !tr_bencDictFindDict( &newMetainfo, "info", &tmp ) ); tr_bencMergeDicts( tr_bencDictAddDict( &newMetainfo, "info", 0 ), &infoDict ); success = tr_metainfoParse( tor->session, &newMetainfo, &tor->info, diff --git a/libtransmission/torrent.c b/libtransmission/torrent.c index a808e2f0e..e04c636cf 100644 --- a/libtransmission/torrent.c +++ b/libtransmission/torrent.c @@ -765,10 +765,9 @@ tr_torrentNew( const tr_ctor * ctor, int * setmeError ) tr_info tmpInfo; tr_parse_result r; tr_torrent * tor = NULL; - tr_session * session = tr_ctorGetSession( ctor ); assert( ctor != NULL ); - assert( tr_isSession( session ) ); + assert( tr_isSession( tr_ctorGetSession( ctor ) ) ); r = torrentParseImpl( ctor, &tmpInfo, &hasInfo, &off, &len ); if( r == TR_PARSE_OK ) diff --git a/libtransmission/web.c b/libtransmission/web.c index 7760fb076..dc027ed19 100644 --- a/libtransmission/web.c +++ b/libtransmission/web.c @@ -350,7 +350,7 @@ addTask( void * vtask ) host = tr_strdup_printf( "Host: %s:%d", task->host, task->port ); task->slist = curl_slist_append( NULL, host ); - task->slist = curl_slist_append( task->slist, tr_strdup_printf( "Accept:" ) ); + task->slist = curl_slist_append( task->slist, "Accept:" ); curl_easy_setopt( e, CURLOPT_HTTPHEADER, task->slist ); tr_free( host ); }