Changeset 6515


Ignore:
Timestamp:
Aug 14, 2008, 10:39:27 AM (13 years ago)
Author:
muks
Message:

Fix leak of torrents

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/rpc.c

    r6510 r6515  
    364364    tr_benc * list = tr_bencDictAddList( args_out, "torrents", torrentCount );
    365365    tr_benc * fields;
    366 
    367     if( !tr_bencDictFindList( args_in, "fields", &fields ) )
    368         return "no fields specified";
     366    char *msg = NULL;
     367
     368    if( !tr_bencDictFindList( args_in, "fields", &fields ) ) {
     369        msg = "no fields specified";
     370        goto out;
     371    }
    369372
    370373    for( i=0; i<torrentCount; ++i )
    371374        addInfo( torrents[i], tr_bencListAdd( list ), fields );
    372375
     376out:
    373377    tr_free( torrents );
    374     return NULL;
     378    return msg;
    375379}
    376380
Note: See TracChangeset for help on using the changeset viewer.