(trunk libT) fix a potential (but currently unused) code path in tr_torrentNew() that could cause a memory leak. Thanks to Elbandi for pointing this out.

This commit is contained in:
Charles Kerr 2010-02-15 00:22:18 +00:00
parent 2421798dd9
commit 6407e38df7
1 changed files with 3 additions and 2 deletions

View File

@ -781,12 +781,13 @@ tr_torrentNew( const tr_ctor * ctor, int * setmeError )
} }
torrentInit( tor, ctor ); torrentInit( tor, ctor );
} }
else if( setmeError ) else
{ {
if( r == TR_PARSE_DUPLICATE ) if( r == TR_PARSE_DUPLICATE )
tr_metainfoFree( &tmpInfo ); tr_metainfoFree( &tmpInfo );
*setmeError = r; if( setmeError )
*setmeError = r;
} }
return tor; return tor;