]> git.puffer.fish Git - mirror/frr.git/commitdiff
mgmtd: Fix fd leak. 13094/head
authorLoganaden Velvindron <logan@cyberstorm.mu>
Thu, 23 Mar 2023 19:07:06 +0000 (23:07 +0400)
committerLoganaden Velvindron <logan@cyberstorm.mu>
Thu, 23 Mar 2023 19:07:06 +0000 (23:07 +0400)
Close fd before returning to avoid leaks.

Signed-off-by: Loganaden Velvindron <logan@cyberstorm.mu>
mgmtd/mgmt_history.c

index 75def3a05e0e02a824b2c964af40a6b50b18c2bd..0e664bc0f11935cd31dbd10fa55dd70d0881b219 100644 (file)
@@ -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;
                }