From bfb0a1ec1a3f16266faa87a1df6d87c7fdc846de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=AD=E5=85=B4=E6=AD=A6?= <951620110@qq.com> Date: Wed, 4 Dec 2024 02:55:09 +0000 Subject: [PATCH] fix return without close fd MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 郭兴武 <951620110@qq.com> --- frameworks/native/ability/native/recovery/app_recovery.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/frameworks/native/ability/native/recovery/app_recovery.cpp b/frameworks/native/ability/native/recovery/app_recovery.cpp index 57fe016c9ef..4d6e20280a3 100644 --- a/frameworks/native/ability/native/recovery/app_recovery.cpp +++ b/frameworks/native/ability/native/recovery/app_recovery.cpp @@ -480,6 +480,7 @@ bool AppRecovery::GetMissionIds(std::string path, std::vector &missionI while ((ptr = readdir(dir)) != nullptr) { if (ptr == nullptr) { TAG_LOGE(AAFwkTag::RECOVERY, "read dir error."); + closedir(dir); return false; } if (strcmp(ptr->d_name, ".") == 0 || strcmp(ptr->d_name, "..") == 0) { -- Gitee