commit | 67ef60a29333784d09245762e8270727cc758945 | [log] [tgz] |
---|---|---|
author | Thomas Jarosch <thomas.jarosch@intra2net.com> | Mon Oct 03 05:24:08 2011 +0000 |
committer | Stephen Hemminger <shemminger@vyatta.com> | Fri Oct 07 11:18:41 2011 -0700 |
tree | de76ef01c3a72eb6fbc495a23f4f4484b62f2051 | |
parent | 25352af7c2ee7291ac54a00a77b7e1de20676fe6 [diff] |
Fix file descriptor leak on error in read_viftable() Detected by cppcheck. Signed-off-by: Thomas Jarosch <thomas.jarosch@intra2net.com>
diff --git a/ip/ipmroute.c b/ip/ipmroute.c index a4389f5..f033349 100644 --- a/ip/ipmroute.c +++ b/ip/ipmroute.c
@@ -58,9 +58,10 @@ 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];