Fix file descriptor leak on error in read_viftable()
Subsystems (2)
PATCH 8/11 Fix file descriptor leak on error in read_viftable()
Detected by cppcheck.
Signed-off-by Thomas Jarosch <[email protected]>
--- ip/ipmroute.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-)
ip/ipmroute.c +3 -2
@@ -58,9 +58,10 @@ static void read_viftable(void)if (!fp)return ; -if (!fgets (buf,sizeof (buf), fp)) +if (!fgets (buf,sizeof (buf), fp)) { +fclose (fp);return ; - + }while (fgets (buf,sizeof (buf), fp)) {int vifi;char dev[256 ];
Signature · 1 line
1.7.4.4