From 4285addef1e67f3d4c4b01ca3cbe5b7a2cae4d89 Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Sat, 23 Dec 2006 14:01:14 +0100 Subject: [PATCH] sensors plugin: Avoid assertion in ignorelist_match () when not configured. If the sensors plugin is not configured (i.e. default settings are used) the ignorelist (sensors_list) is never created causing the assertion in ignorelist_match () to fail. This fixes it. Signed-off-by: Sebastian Harl --- src/sensors.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/sensors.c b/src/sensors.c index d15569c0..66cd5b22 100644 --- a/src/sensors.c +++ b/src/sensors.c @@ -393,7 +393,8 @@ static void sensors_shutdown (void) sensors_free_features (); #endif /* if SENSORS_HAVE_READ */ - ignorelist_free (sensor_list); + if (NULL != sensor_list) + ignorelist_free (sensor_list); } static void sensors_voltage_write (char *host, char *inst, char *val) @@ -402,7 +403,7 @@ static void sensors_voltage_write (char *host, char *inst, char *val) int status; /* skip ignored in our config */ - if (ignorelist_match (sensor_list, inst)) + if ((NULL != sensor_list) && ignorelist_match (sensor_list, inst)) return; /* extended sensor naming */ @@ -423,7 +424,7 @@ static void sensors_write (char *host, char *inst, char *val) int status; /* skip ignored in our config */ - if (ignorelist_match (sensor_list, inst)) + if ((NULL != sensor_list) && ignorelist_match (sensor_list, inst)) return; /* extended sensor naming */ @@ -450,7 +451,7 @@ static void sensors_submit (const char *feat_name, return; /* skip ignored in our config */ - if (ignorelist_match (sensor_list, inst)) + if ((NULL != sensor_list) && ignorelist_match (sensor_list, inst)) return; if (snprintf (buf, BUFSIZE, "%u:%.3f", (unsigned int) curtime, -- 2.11.0