Ignore:
Timestamp:
Jan 4, 2010, 9:11:27 AM (12 years ago)
Author:
charles
Message:

(trunk libT) #2722 "crash when removing/modifying trackers" -- fixed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/torrent.c

    r9859 r9860  
    20902090    int i;
    20912091    tr_benc metainfo;
     2092    tr_bool ok = TRUE;
     2093    tr_torrentLock( tor );
    20922094
    20932095    assert( tr_isTorrent( tor ) );
    20942096
    20952097    /* look for bad URLs */
    2096     for( i=0; i<trackerCount; ++i )
     2098    for( i=0; ok && i<trackerCount; ++i )
    20972099        if( !tr_httpIsValidURL( trackers[i].announce ) )
    2098             return TR_ANNOUNCE_LIST_HAS_BAD;
     2100            ok = FALSE;
    20992101
    21002102    /* save to the .torrent file */
    2101     if( !tr_bencLoadFile( &metainfo, TR_FMT_BENC, tor->info.torrent ) )
     2103    if( ok && !tr_bencLoadFile( &metainfo, TR_FMT_BENC, tor->info.torrent ) )
    21022104    {
    21032105        tr_info   tmpInfo;
     
    21562158    }
    21572159
    2158     return TR_ANNOUNCE_LIST_OK;
     2160    tr_torrentUnlock( tor );
     2161    return ok ? TR_ANNOUNCE_LIST_OK : TR_ANNOUNCE_LIST_HAS_BAD;
    21592162}
    21602163
Note: See TracChangeset for help on using the changeset viewer.