From b69017f455110c2186ff46f513f97d9b95deaf8c Mon Sep 17 00:00:00 2001 From: Loganaden Velvindron Date: Thu, 23 Mar 2023 23:07:06 +0400 Subject: [PATCH] mgmtd: Fix fd leak. Close fd before returning to avoid leaks. Signed-off-by: Loganaden Velvindron --- mgmtd/mgmt_history.c | 1 + 1 file changed, 1 insertion(+) diff --git a/mgmtd/mgmt_history.c b/mgmtd/mgmt_history.c index 75def3a05e..0e664bc0f1 100644 --- a/mgmtd/mgmt_history.c +++ b/mgmtd/mgmt_history.c @@ -143,6 +143,7 @@ static bool mgmt_history_read_cmt_record_index(void) } else { zlog_err("More records found in index file %s", MGMTD_COMMIT_INDEX_FILE_NAME); + fclose(fp); return false; }