]> granicus.if.org Git - transmission/commitdiff
(trunk libT) fix refcount error in the new peer-io refcount code
authorCharles Kerr <charles@transmissionbt.com>
Tue, 6 Jan 2009 03:21:22 +0000 (03:21 +0000)
committerCharles Kerr <charles@transmissionbt.com>
Tue, 6 Jan 2009 03:21:22 +0000 (03:21 +0000)
libtransmission/peer-mgr.c

index dd56d2e83142c111359a488cf8ee07cf4e7274bf..b938c2af610f2b1c677e27368a7c985ba32897e6 100644 (file)
@@ -1258,8 +1258,8 @@ myHandshakeDoneCB( tr_handshake  * handshake,
                 }
 
                 peer->port = port;
-                peer->io = tr_handshakeStealIO( handshake );
-                tr_peerIoRef( peer->io ); /* balanced by the unref in peerDestructor() */
+                peer->io = tr_handshakeStealIO( handshake ); /* this steals its refcount too, which is
+                                                                balanced by our unref in peerDestructor()  */
                 tr_peerIoSetParent( peer->io, t->tor->bandwidth );
                 tr_peerMsgsNew( t->tor, peer, peerCallbackFunc, t, &peer->msgsTag );