mirror of
https://github.com/transmission/transmission
synced 2025-01-03 05:25:52 +00:00
(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:
parent
192365d4f9
commit
67c1c6db95
1 changed files with 1 additions and 1 deletions
|
@ -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 )
|
||||
|
|
Loading…
Reference in a new issue