mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-11-08 16:11:26 +00:00
Fix segmentation fault when passing a custom configuration file.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@5665 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
1 parent
857d25dff4
commit
c7eab7030f
1 file changed
+8
-5
+8
-5
@@ -91,11 +91,14 @@ static int parse_config(FILE *input, const char *name)
|
||||
int err;
|
||||
char *name_copy;
|
||||
|
||||
/* Record configuration file name for error reporting */
|
||||
name_copy = strdup(name);
|
||||
if (!name_copy)
|
||||
sensors_fatal_error(__func__, "Out of memory");
|
||||
sensors_add_config_files(&name_copy);
|
||||
if (name) {
|
||||
/* Record configuration file name for error reporting */
|
||||
name_copy = strdup(name);
|
||||
if (!name_copy)
|
||||
sensors_fatal_error(__func__, "Out of memory");
|
||||
sensors_add_config_files(&name_copy);
|
||||
} else
|
||||
name_copy = NULL;
|
||||
|
||||
if (sensors_scanner_init(input, name_copy)) {
|
||||
err = -SENSORS_ERR_PARSE;
|
||||
|
||||
Reference in new issue
Block a user