Changeset 11258


Ignore:
Timestamp:
Sep 23, 2010, 5:05:40 PM (12 years ago)
Author:
charles
Message:

(trunk gtk) fix a minor UMR error that Valgrind found

File:
1 edited

Legend:

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

    r11197 r11258  
    15901590readResponseIdle( void * vresponse )
    15911591{
    1592     GByteArray * response;
    15931592    tr_benc top;
    15941593    int64_t intVal;
    1595     int tag;
    1596     struct pending_request_data * data;
    1597 
    1598     response = vresponse;
     1594    GByteArray * response = vresponse;
     1595
    15991596    tr_jsonParse( NULL, response->data, response->len, &top, NULL );
    1600     tr_bencDictFindInt( &top, "tag", &intVal );
    1601     tag = (int)intVal;
    1602 
    1603     data = g_hash_table_lookup( pendingRequests, &tag );
    1604     if( data && data->responseFunc )
    1605         (*data->responseFunc)(data->core, &top, data->responseFuncUserData );
     1597
     1598    if( tr_bencDictFindInt( &top, "tag", &intVal ) )
     1599    {
     1600        const int tag = (int)intVal;
     1601        struct pending_request_data * data = g_hash_table_lookup( pendingRequests, &tag );
     1602        if( data ) {
     1603            if( data->responseFunc )
     1604                (*data->responseFunc)(data->core, &top, data->responseFuncUserData );
     1605            g_hash_table_remove( pendingRequests, &tag );
     1606        }
     1607    }
    16061608
    16071609    tr_bencFree( &top );
    1608     g_hash_table_remove( pendingRequests, &tag );
    16091610    g_byte_array_free( response, TRUE );
    16101611    return FALSE;
Note: See TracChangeset for help on using the changeset viewer.