From 99fff2bda1f2261bf22d45114ae264501fb26ccc Mon Sep 17 00:00:00 2001 From: TaowerfulMAX Date: Fri, 14 Mar 2025 17:34:50 +0800 Subject: [PATCH] fix: the memory leak due to variable openReq being unreleased. Signed-off-by: TaowerfulMAX --- src/common/file.cpp | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/common/file.cpp b/src/common/file.cpp index 9170c156..d3082368 100644 --- a/src/common/file.cpp +++ b/src/common/file.cpp @@ -432,13 +432,6 @@ bool HdcFile::HandleFileExistenceAndNewness() bool HdcFile::BeginFileOperations() { - uv_fs_t *openReq = new uv_fs_t; - if (openReq == nullptr) { - LogMsg(MSG_FAIL, "HdcFile::SlaveCheck new openReq failed"); - return false; - } - memset_s(openReq, sizeof(uv_fs_t), 0, sizeof(uv_fs_t)); - openReq->data = &ctxNow; ++refCount; uv_fs_open(loopTask, &ctxNow.fsOpenReq, ctxNow.localPath.c_str(), UV_FS_O_TRUNC | UV_FS_O_CREAT | UV_FS_O_WRONLY, S_IWUSR | S_IRUSR | S_IRGRP | S_IROTH, OnFileOpen); -- Gitee