summaryrefslogtreecommitdiff
path: root/mgmtd/mgmt_history.c
diff options
context:
space:
mode:
authorLoganaden Velvindron <logan@cyberstorm.mu>2023-03-23 23:07:06 +0400
committerLoganaden Velvindron <logan@cyberstorm.mu>2023-03-23 23:07:06 +0400
commitb69017f455110c2186ff46f513f97d9b95deaf8c (patch)
treedbd5f460efc8a3288be545e7d2f21f0e30f4270b /mgmtd/mgmt_history.c
parent6927446645221898256a6ec37653bb31a301db72 (diff)
mgmtd: Fix fd leak.
Close fd before returning to avoid leaks. Signed-off-by: Loganaden Velvindron <logan@cyberstorm.mu>
Diffstat (limited to 'mgmtd/mgmt_history.c')
-rw-r--r--mgmtd/mgmt_history.c1
1 files changed, 1 insertions, 0 deletions
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;
}