mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-11-16 01:57:09 +00:00
Close file only if it was successfully opened
If BUILD_IPV6=ON (default), but the user has disabled ipv6 support in the kernel using the parameter ipv6.disable=1, then conky fails to open /proc/net/if_inet6. This leads to a segfault when conky calls fclose(file) regardless. This fix simply moves the fclose call into the preceding if statement.
This commit is contained in:
parent
58abe0e91d
commit
ee08a9e1b0
@ -643,8 +643,8 @@ int update_net_stats(void)
|
|||||||
}
|
}
|
||||||
lastv6->next = NULL;
|
lastv6->next = NULL;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
fclose(file);
|
fclose(file);
|
||||||
|
}
|
||||||
#endif /* BUILD_IPV6 */
|
#endif /* BUILD_IPV6 */
|
||||||
|
|
||||||
first = 0;
|
first = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user