2
0
mirror of https://github.com/lm-sensors/lm-sensors synced 2025-09-01 14:55:27 +00:00

Fix error path on library initialization error. Only call fclose() if

we have actually opened a configuration file before.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5090 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Jean Delvare
2008-01-05 09:14:28 +00:00
parent 1cf9ea0c54
commit 7a2649483e
2 changed files with 3 additions and 1 deletions

View File

@@ -105,7 +105,8 @@ static int read_config_file(const char *config_file_name)
err = sensors_init(config_file);
if (err) {
fprintf(stderr, "sensors_init: %s\n", sensors_strerror(err));
fclose(config_file);
if (config_file)
fclose(config_file);
return 1;
}