]> granicus.if.org Git - transmission/commitdiff
fix minor memory leak in tr_close()
authorCharles Kerr <charles@transmissionbt.com>
Thu, 17 Apr 2008 18:45:02 +0000 (18:45 +0000)
committerCharles Kerr <charles@transmissionbt.com>
Thu, 17 Apr 2008 18:45:02 +0000 (18:45 +0000)
libtransmission/session.c

index 75134ca8e8146886c550ac7fa1b706d9a7d454ae..5e738f32deafc4a5d44f92d0736f8f33d30937a0 100644 (file)
@@ -163,12 +163,7 @@ tr_initFull( const char * configDir,
     while( !h->events )
         tr_wait( 50 );
 
-    h->tag = strdup( tag );
-    if( !h->tag ) {
-        free( h );
-        return NULL;
-    }
-
+    h->tag = tr_strdup( tag );
     h->peerMgr = tr_peerMgrNew( h );
 
     /* Initialize rate and file descripts controls */
@@ -436,7 +431,10 @@ tr_close( tr_handle * h )
 
     tr_fdClose( );
     tr_lockFree( h->lock );
-    free( h->tag );
+    tr_free( h->tag );
+    tr_free( h->configDir );
+    tr_free( h->resumeDir );
+    tr_free( h->torrentDir );
     free( h );
 }