Commit e588a7db authored by Thomas Jarosch's avatar Thomas Jarosch Committed by Stephen Hemminger

Fix file descriptor leak on error in read_mroute_list()

Detected by cppcheck.
Signed-off-by: default avatarThomas Jarosch <thomas.jarosch@intra2net.com>
parent 67ef60a2
......@@ -85,8 +85,10 @@ static void read_mroute_list(FILE *ofp)
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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment