Changeset 3098


Ignore:
Timestamp:
Sep 18, 2007, 4:56:53 PM (15 years ago)
Author:
charles
Message:

fix a memory leak and delete some dead code.

Location:
branches/encryption/libtransmission
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/encryption/libtransmission/crypto.c

    r2985 r3098  
    204204}
    205205
    206 
    207 #if 0
    208 void
    209 tr_cryptoReadUint16( tr_crypto        * crypto,
    210                      struct evbuffer  * inbuf,
    211                      uint16_t         * setme )
    212 {
    213     uint16_t tmp;
    214     assert( EVBUFFER_LENGTH(inbuf) >= sizeof(uint16_t) );
    215     evbuffer_remove( inbuf, &tmp, sizeof(uint16_t) );
    216     tr_cryptoDecrypt( crypto, sizeof(uint16_t), &tmp, &tmp );
    217     *setme = ntohs( tmp );
    218 }
    219 
    220 void
    221 tr_cryptoReadUint32( tr_crypto        * crypto,
    222                      struct evbuffer  * inbuf,
    223                      uint32_t         * setme )
    224 {
    225     uint32_t tmp;
    226     assert( EVBUFFER_LENGTH(inbuf) >= sizeof(uint32_t) );
    227     evbuffer_remove( inbuf, &tmp, sizeof(uint32_t) );
    228     tr_cryptoDecrypt( crypto, sizeof(uint32_t), &tmp, &tmp );
    229     *setme = ntohl( tmp );
    230 }
    231 
    232 void
    233 tr_cryptoReadBytes( tr_crypto        * crypto,
    234                     struct evbuffer  * inbuf,
    235                     uint8_t          * bytes,
    236                     int                byteCount )
    237 {
    238     assert( (int)EVBUFFER_LENGTH(inbuf) >= byteCount );
    239     evbuffer_remove( inbuf, bytes, byteCount );
    240     tr_cryptoDecrypt( crypto, byteCount, bytes, bytes );
    241 }
    242 #endif
    243 
    244 /**
    245 ***
    246 **/
    247 
    248206void
    249207tr_cryptoEncryptInit( tr_crypto * crypto )
  • branches/encryption/libtransmission/peer-mgr.c

    r3095 r3098  
    399399    tr_free( req );
    400400    tr_free( unreq );
     401    tr_free( pieces );
    401402
    402403    return ret;
Note: See TracChangeset for help on using the changeset viewer.