[TD-3710]<fix>: [sync/memory] fix peer connection invalid read post freeing

This commit is contained in:
Minglei Jin 2021-04-08 18:09:41 +08:00
parent 891cf50ce9
commit 278fc08441
1 changed files with 4 additions and 1 deletions

View File

@ -551,7 +551,10 @@ static void syncClosePeerConn(SSyncPeer *pPeer) {
if (pPeer->peerFd >= 0) {
pPeer->peerFd = -1;
void *pConn = pPeer->pConn;
if (pConn != NULL) syncFreeTcpConn(pPeer->pConn);
if (pConn != NULL) {
syncFreeTcpConn(pPeer->pConn);
pPeer->pConn = NULL;
}
}
}