(trunk libT) possible fix for #2301, which is a valgrind complaint about uninitialized memory being written to disk while saving the bencoded .resume file. this commit theorizes that the warning is caused by not zeroing out the tr_peer array before filling it, so the extra bits in tr_addresses' ipv4/ipv6 union were never initialized. if this theory is correct, this commit (which zeros the memory first) should fix the bug.

This commit is contained in:
Charles Kerr 2009-08-07 00:58:34 +00:00
parent 192365d4f9
commit 67c1c6db95
1 changed files with 1 additions and 1 deletions

View File

@ -1537,7 +1537,7 @@ tr_peerMgrGetPeers( tr_torrent * tor,
const int peerCount = tr_ptrArraySize( &t->peers );
/* for now, this will waste memory on torrents that have both
* ipv6 and ipv4 peers */
tr_pex * pex = tr_new( tr_pex, peerCount );
tr_pex * pex = tr_new0( tr_pex, peerCount );
tr_pex * walk = pex;
for( i=0; i<peerCount; ++i )