1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-11-15 17:47: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:
Marc Payne 2015-07-06 02:51:43 -06:00
parent 58abe0e91d
commit ee08a9e1b0

View File

@ -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;