!1629 fix fd leak in tcp mode

Merge pull request !1629 from zhaolihui/fix_fd_leak_in_tcp_mode
This commit is contained in:
openharmony_ci 2024-10-24 02:23:39 +00:00 committed by Gitee
commit cc290419ce
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -586,6 +586,7 @@ void HdcSessionBase::FreeSessionContinue(HSession hSession)
if (hSession->connType == CONN_TCP) {
// Turn off TCP to prevent continuing writing
Base::TryCloseHandle((uv_handle_t *)&hSession->hWorkTCP, true, closeSessionTCPHandle);
Base::CloseFd(hSession->dataFd[STREAM_WORK]);
}
hSession->availTailIndex = 0;
if (hSession->ioBuf) {