Merge pull request #13711 from FRRouting/mergify/bp/dev/9.0/pr-13706

lib: close config files after reading (coverity) (backport #13706)
This commit is contained in:
Donatas Abraitis 2023-06-07 13:23:14 +03:00 committed by GitHub
commit c3f7381eaf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2217,6 +2217,8 @@ bool mgmt_vty_read_configs(void)
line_num = 0; line_num = 0;
(void)config_from_file(vty, confp, &line_num); (void)config_from_file(vty, confp, &line_num);
count++; count++;
fclose(confp);
} }
snprintf(path, sizeof(path), "%s/mgmtd.conf", frr_sysconfdir); snprintf(path, sizeof(path), "%s/mgmtd.conf", frr_sysconfdir);
@ -2240,6 +2242,8 @@ bool mgmt_vty_read_configs(void)
line_num = 0; line_num = 0;
(void)config_from_file(vty, confp, &line_num); (void)config_from_file(vty, confp, &line_num);
count++; count++;
fclose(confp);
} }
vty->pending_allowed = false; vty->pending_allowed = false;