Fix file descriptor leak on error in read_viftable()
Detected by cppcheck. Signed-off-by: Thomas Jarosch <thomas.jarosch@intra2net.com>
This commit is contained in:
parent
25352af7c2
commit
67ef60a293
|
|
@ -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];
|
||||
|
|
|
|||
Loading…
Reference in New Issue