mirror of
https://github.com/transmission/transmission.git
synced 2026-05-08 09:39:08 +01:00
fix some memory leaks reported by valgrind.
This commit is contained in:
+2
-1
@@ -132,11 +132,12 @@ cf_removelocks( void )
|
||||
gboolean
|
||||
cf_lock( char ** errstr )
|
||||
{
|
||||
const char * path = getLockFilename( );
|
||||
char * path = getLockFilename( );
|
||||
int fd = lockfile( path, errstr );
|
||||
if( fd >= 0 )
|
||||
gl_lockpath = g_strdup( path );
|
||||
g_atexit( cf_removelocks );
|
||||
g_free( path );
|
||||
return fd >= 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -818,6 +818,7 @@ dbgmsg( handshake, "reading IA..." );
|
||||
i = parseHandshake( handshake, inbuf );
|
||||
dbgmsg( handshake, "parseHandshake returned %d", i );
|
||||
if( i != HANDSHAKE_OK ) {
|
||||
evbuffer_free( outbuf );
|
||||
tr_handshakeDone( handshake, FALSE );
|
||||
return READ_DONE;
|
||||
}
|
||||
|
||||
@@ -1642,7 +1642,7 @@ tr_peerMsgsNew( struct tr_torrent * torrent,
|
||||
m->inBlock = evbuffer_new( );
|
||||
m->peerAllowedPieces = NULL;
|
||||
m->clientAllowedPieces = NULL;
|
||||
setme = tr_publisherSubscribe( m->publisher, func, userData );
|
||||
*setme = tr_publisherSubscribe( m->publisher, func, userData );
|
||||
|
||||
if ( tr_peerIoSupportsFEXT( m->io ) )
|
||||
{
|
||||
@@ -1744,4 +1744,3 @@ tr_peerMsgIsPieceFastAllowed( const tr_peermsgs * peer,
|
||||
{
|
||||
return tr_bitfieldHas( peer->clientAllowedPieces, index );
|
||||
}
|
||||
|
||||
|
||||
@@ -708,6 +708,7 @@ onTrackerResponse( struct evhttp_request * req, void * torrent_hash )
|
||||
int responseCode;
|
||||
|
||||
t = findTrackerFromHash( torrent_hash );
|
||||
tr_free( torrent_hash );
|
||||
if( t == NULL ) /* tracker has been closed */
|
||||
return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user