Commit 67ef60a2 authored by Thomas Jarosch's avatar Thomas Jarosch Committed by Stephen Hemminger

Fix file descriptor leak on error in read_viftable()

Detected by cppcheck.
Signed-off-by: default avatarThomas Jarosch <thomas.jarosch@intra2net.com>
parent 25352af7
......@@ -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];
......
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