Changeset 3268


Ignore:
Timestamp:
Oct 2, 2007, 3:33:17 AM (15 years ago)
Author:
charles
Message:

fix looong-standing potential dangling pointer bug reported by BMW

Location:
trunk/libtransmission
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/peer-mgr.c

    r3266 r3268  
    13211321        stat->port             = peer->port;
    13221322        stat->from             = atom->from;
    1323         stat->client           = peer->client;
     1323        stat->client           = tr_strdup( peer->client ? peer->client : "" );
    13241324        stat->progress         = peer->progress;
    13251325        stat->isEncrypted      = tr_peerIoIsEncrypted( peer->io ) ? 1 : 0;
  • trunk/libtransmission/torrent.c

    r3267 r3268  
    905905}
    906906
    907 void tr_torrentPeersFree( tr_peer_stat * peers, int peerCount UNUSED )
    908 {
     907void
     908tr_torrentPeersFree( tr_peer_stat * peers, int peerCount )
     909{
     910    int i;
     911    for( i=0; i<peerCount; ++i )
     912        tr_free( (char*) peers[i].client );
    909913    tr_free( peers );
    910914}
Note: See TracChangeset for help on using the changeset viewer.