Changeset 8399


Ignore:
Timestamp:
May 14, 2009, 5:18:17 PM (12 years ago)
Author:
charles
Message:

(trunk) fix a couple of memory leaks.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/tr-core.c

    r8279 r8399  
    520520    if( isEnabled )
    521521    {
     522        const char * basename;
    522523        const char * dirname = pref_string_get( PREF_KEY_DIR_WATCH );
    523         GDir *       dir = g_dir_open( dirname, 0, NULL );
    524         const char * basename;
    525         while( ( basename = g_dir_read_name( dir ) ) )
     524        GDir * dir = g_dir_open( dirname, 0, NULL );
     525
     526        while(( basename = g_dir_read_name( dir )))
    526527        {
    527528            char * filename = g_build_filename( dirname, basename, NULL );
     
    529530            g_free( filename );
    530531        }
     532
     533        g_dir_close( dir );
    531534    }
    532535}
     
    860863    if( filename && session )
    861864    {
    862         tr_ctor * ctor;
    863 
    864         ctor = tr_ctorNew( session );
     865        tr_ctor * ctor = tr_ctorNew( session );
    865866        tr_core_apply_defaults( ctor );
    866867        tr_ctorSetPaused( ctor, TR_FORCE, !doStart );
     
    869870        {
    870871            tr_core_errsig( core, TR_EINVALID, filename );
    871             tr_ctorFree( ctor );
    872872        }
    873873        else
     
    905905            }
    906906        }
     907
     908        tr_ctorFree( ctor );
    907909    }
    908910}
  • trunk/libtransmission/rpc-server.c

    r8368 r8399  
    819819    deflateEnd( &s->stream );
    820820#endif
     821    tr_free( s->sessionId );
    821822    tr_free( s->whitelistStr );
    822823    tr_free( s->username );
Note: See TracChangeset for help on using the changeset viewer.