From: Pavel Rochnyack Date: Wed, 25 May 2016 07:15:31 +0000 (+0600) Subject: disk plugin: Call disk_udev_attr_name() only when UdevNameAttr configured X-Git-Tag: collectd-5.6.0~297^2~1 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=bdbc066e4646876a774e940995859a4760b8946c;p=collectd.git disk plugin: Call disk_udev_attr_name() only when UdevNameAttr configured --- diff --git a/src/disk.c b/src/disk.c index 0d624886..07383c75 100644 --- a/src/disk.c +++ b/src/disk.c @@ -867,9 +867,13 @@ static int disk_read (void) output_name = disk_name; #if HAVE_LIBUDEV - char *alt_name = disk_udev_attr_name (handle_udev, disk_name, conf_udev_name_attr); - if (alt_name != NULL) - output_name = alt_name; + char *alt_name = NULL; + if (conf_udev_name_attr != NULL) + { + alt_name = disk_udev_attr_name (handle_udev, disk_name, conf_udev_name_attr); + if (alt_name != NULL) + output_name = alt_name; + } #endif if (ignorelist_match (ignorelist, output_name) != 0)