diff --git a/CHANGES b/CHANGES index 8498c867..536aefaa 100644 --- a/CHANGES +++ b/CHANGES @@ -4,6 +4,7 @@ lm-sensors CHANGES file SVN HEAD libsensors: Add a default configuration file Fix memory leaks on initialization error + Make the configuration file optional sensord: Reload config on SIGHUP rather than automatically No default configuration file name sensors: Fix file handle leak on library initialization error diff --git a/lib/init.c b/lib/init.c index 01c68a88..8dd1f3b7 100644 --- a/lib/init.c +++ b/lib/init.c @@ -49,14 +49,14 @@ int sensors_init(FILE *input) } else { /* No configuration provided, use default */ input = fopen(DEFAULT_CONFIG_FILE, "r"); - if (!input) - goto exit_cleanup; - if (sensors_scanner_init(input) || - sensors_yyparse()) { + if (input) { + if (sensors_scanner_init(input) || + sensors_yyparse()) { + fclose(input); + goto exit_cleanup; + } fclose(input); - goto exit_cleanup; } - fclose(input); } if ((res = sensors_substitute_busses()))