From 9699353a082a7fa22564b84f4c73a8ccfb1e7537 Mon Sep 17 00:00:00 2001 From: Yonghua Huang Date: Thu, 10 Feb 2022 07:18:59 +0300 Subject: [PATCH] tools: fix memory leakage issue in acrnlog.c In function mk_dir(), handler 'dir' returned by opendir() is not released before function return and results in memory leakage. Tracked-On: #7098 Signed-off-by: Yonghua Huang --- misc/debug_tools/acrn_log/acrnlog.c | 1 + 1 file changed, 1 insertion(+) diff --git a/misc/debug_tools/acrn_log/acrnlog.c b/misc/debug_tools/acrn_log/acrnlog.c index e84f2eeb8..24cbe793e 100644 --- a/misc/debug_tools/acrn_log/acrnlog.c +++ b/misc/debug_tools/acrn_log/acrnlog.c @@ -414,6 +414,7 @@ static int mk_dir(const char *path) } else remove(acrnlog_file); } + closedir(dir); } return 0;