1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-26 09:37:56 +00:00

(trunk libT) Yippie, plug a small memory leak reported by valgrind!

This commit is contained in:
Charles Kerr 2010-02-10 05:27:14 +00:00
parent a95aae5591
commit 9fffb2be35
3 changed files with 2 additions and 5 deletions

View file

@ -200,14 +200,12 @@ tr_torrentSetMetadataPiece( tr_torrent * tor, int piece, const void * data, in
if( !tr_bencLoadFile( &newMetainfo, TR_FMT_BENC, path ) ) if( !tr_bencLoadFile( &newMetainfo, TR_FMT_BENC, path ) )
{ {
tr_bool hasInfo; tr_bool hasInfo;
tr_benc * tmp;
/* remove any old .torrent and .resume files */ /* remove any old .torrent and .resume files */
remove( path ); remove( path );
tr_torrentRemoveResume( tor ); tr_torrentRemoveResume( tor );
dbgmsg( tor, "Saving completed metadata to \"%s\"", path ); dbgmsg( tor, "Saving completed metadata to \"%s\"", path );
assert( !tr_bencDictFindDict( &newMetainfo, "info", &tmp ) );
tr_bencMergeDicts( tr_bencDictAddDict( &newMetainfo, "info", 0 ), &infoDict ); tr_bencMergeDicts( tr_bencDictAddDict( &newMetainfo, "info", 0 ), &infoDict );
success = tr_metainfoParse( tor->session, &newMetainfo, &tor->info, success = tr_metainfoParse( tor->session, &newMetainfo, &tor->info,

View file

@ -765,10 +765,9 @@ tr_torrentNew( const tr_ctor * ctor, int * setmeError )
tr_info tmpInfo; tr_info tmpInfo;
tr_parse_result r; tr_parse_result r;
tr_torrent * tor = NULL; tr_torrent * tor = NULL;
tr_session * session = tr_ctorGetSession( ctor );
assert( ctor != NULL ); assert( ctor != NULL );
assert( tr_isSession( session ) ); assert( tr_isSession( tr_ctorGetSession( ctor ) ) );
r = torrentParseImpl( ctor, &tmpInfo, &hasInfo, &off, &len ); r = torrentParseImpl( ctor, &tmpInfo, &hasInfo, &off, &len );
if( r == TR_PARSE_OK ) if( r == TR_PARSE_OK )

View file

@ -350,7 +350,7 @@ addTask( void * vtask )
host = tr_strdup_printf( "Host: %s:%d", task->host, task->port ); host = tr_strdup_printf( "Host: %s:%d", task->host, task->port );
task->slist = curl_slist_append( NULL, host ); 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 ); curl_easy_setopt( e, CURLOPT_HTTPHEADER, task->slist );
tr_free( host ); tr_free( host );
} }