Commit 19bcc05b authored by Thomas Jarosch's avatar Thomas Jarosch Committed by Stephen Hemminger

Fix file descriptor leak on error in read_igmp()

Detected by cppcheck.
Signed-off-by: default avatarThomas Jarosch <thomas.jarosch@intra2net.com>
parent 297452a1
...@@ -128,8 +128,10 @@ void read_igmp(struct ma_info **result_p) ...@@ -128,8 +128,10 @@ void read_igmp(struct ma_info **result_p)
if (!fp) if (!fp)
return; return;
memset(&m, 0, sizeof(m)); memset(&m, 0, sizeof(m));
if (!fgets(buf, sizeof(buf), fp)) if (!fgets(buf, sizeof(buf), fp)) {
fclose(fp);
return; return;
}
m.addr.family = AF_INET; m.addr.family = AF_INET;
m.addr.bitlen = 32; m.addr.bitlen = 32;
......
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