Changeset 765


Ignore:
Timestamp:
Aug 13, 2006, 7:55:59 PM (17 years ago)
Author:
livings124
Message:

Fix a memory leak.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/transmission.c

    r764 r765  
    441441        peer = tor->peers[i];
    442442       
    443         char * client = tr_clientForId(tr_peerId(peer));
    444         char clientChar;
    445         int j = 0;
    446         while (j < 25 && (clientChar = client[j]) != 0)
    447         {
    448             s->peers[i].client[j] = clientChar;
    449             j++;
    450         }
    451        
     443        s->peers[i].client = tr_clientForId(tr_peerId(peer));
    452444        s->peers[i].isDownloading = tr_peerIsDownloading(peer);
    453445        s->peers[i].isUploading = tr_peerIsUploading(peer);
  • trunk/libtransmission/transmission.h

    r764 r765  
    282282typedef struct tr_peer_stat_s
    283283{
    284     char    client[25];
     284    char *  client;
    285285   
    286286    int     isDownloading;
  • trunk/macosx/Torrent.m

    r764 r765  
    527527   
    528528        [peers addObject: [NSDictionary dictionaryWithObjectsAndKeys:
    529             [NSString stringWithCString: (char *) peer.client encoding: NSUTF8StringEncoding],
    530                 @"Client",
     529            [NSString stringWithCString: (char *) peer.client encoding: NSUTF8StringEncoding], @"Client",
    531530            [NSNumber numberWithBool: peer.isDownloading], @"UL To",
    532531            [NSNumber numberWithBool: peer.isUploading], @"DL From", nil]];
    533         /*[peers addObject: [NSDictionary dictionaryWithObjectsAndKeys:
    534             @"Client", @"Client",
    535             [NSNumber numberWithBool: YES], @"UL To",
    536             [NSNumber numberWithBool: YES], @"DL From", nil]];*/
    537532    }
    538533    //NSLog(@"%d", tr_peerId(peer));
Note: See TracChangeset for help on using the changeset viewer.