mirror of
https://github.com/lm-sensors/lm-sensors
synced 2025-08-31 22:35:23 +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:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user