From: Christian Hopps Date: Tue, 6 Jun 2023 18:27:04 +0000 (-0400) Subject: lib: close config files after reading (coverity) X-Git-Tag: base_9.1~394^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=f5626596ee5e052fc1116536704cd9c9ba5d7552;p=matthieu%2Ffrr.git lib: close config files after reading (coverity) fixes coverity CID# 1564375 Signed-off-by: Christian Hopps --- diff --git a/lib/vty.c b/lib/vty.c index 50c4f80aae..fedbdbb813 100644 --- a/lib/vty.c +++ b/lib/vty.c @@ -2217,6 +2217,8 @@ bool mgmt_vty_read_configs(void) line_num = 0; (void)config_from_file(vty, confp, &line_num); count++; + + fclose(confp); } snprintf(path, sizeof(path), "%s/mgmtd.conf", frr_sysconfdir); @@ -2240,6 +2242,8 @@ bool mgmt_vty_read_configs(void) line_num = 0; (void)config_from_file(vty, confp, &line_num); count++; + + fclose(confp); } vty->pending_allowed = false;