Changeset 526 for trunk/libtransmission


Ignore:
Timestamp:
Jul 4, 2006, 11:59:51 PM (16 years ago)
Author:
joshe
Message:

Don't try to free memory that we never allocated.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/tracker.c

    r400 r526  
    377377    uint8_t * body;
    378378    int bodylen;
     379    int shouldfree;
    379380
    380381    if( tc->pos == tc->size )
     
    444445
    445446    /* Find and load the dictionary */
     447    shouldfree = 0;
    446448    for( i = 0; i < bodylen; i++ )
    447449    {
    448450        if( !tr_bencLoad( &body[i], bodylen - i, &beAll, NULL ) )
    449451        {
     452            shouldfree = 1;
    450453            break;
    451454        }
     
    597600
    598601cleanup:
    599     tr_bencFree( &beAll );
     602    if( shouldfree )
     603    {
     604        tr_bencFree( &beAll );
     605    }
    600606}
    601607
Note: See TracChangeset for help on using the changeset viewer.