2
0
mirror of https://github.com/lm-sensors/lm-sensors synced 2025-09-02 07:15:39 +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

@@ -11,6 +11,7 @@ SVN
sensord: Fix rrd support (#2276) sensord: Fix rrd support (#2276)
Use the same colors for daily and weekly charts Use the same colors for daily and weekly charts
Drop workaround needed by old versions of rrdtool Drop workaround needed by old versions of rrdtool
sensors: Fix error path on library initialization error
sensors.conf.eg: Fix voltage value references (g520sm, lm80, pc87366) sensors.conf.eg: Fix voltage value references (g520sm, lm80, pc87366)
sensors-detect: Drop PCA9540 detection sensors-detect: Drop PCA9540 detection
Improve sysconfig and modprobe.d integration Improve sysconfig and modprobe.d integration

View File

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