commit | e588a7db167df75e659f99bd3b024eedafed62cc | [log] [tgz] |
---|---|---|
author | Thomas Jarosch <thomas.jarosch@intra2net.com> | Mon Oct 03 05:24:18 2011 +0000 |
committer | Stephen Hemminger <shemminger@vyatta.com> | Fri Oct 07 11:20:21 2011 -0700 |
tree | 6eac7affed8b18d433c8fe6200810b352401abbd | |
parent | 67ef60a29333784d09245762e8270727cc758945 [diff] |
Fix file descriptor leak on error in read_mroute_list() Detected by cppcheck. Signed-off-by: Thomas Jarosch <thomas.jarosch@intra2net.com>
diff --git a/ip/ipmroute.c b/ip/ipmroute.c index f033349..945727d 100644 --- a/ip/ipmroute.c +++ b/ip/ipmroute.c
@@ -85,8 +85,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)) { inet_prefix maddr, msrc;