summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0092ac0)
raw | patch | inline | side by side (parent: 0092ac0)
author | Florian Forster <octo@collectd.org> | |
Fri, 18 Dec 2015 10:11:15 +0000 (11:11 +0100) | ||
committer | Florian Forster <octo@collectd.org> | |
Fri, 18 Dec 2015 10:11:15 +0000 (11:11 +0100) |
Coverity whines about "output_name = alt_name" being dead code because
it sees alt_name as beeing NULL always.
CID: 48417
it sees alt_name as beeing NULL always.
CID: 48417
src/disk.c | patch | blob | history |
diff --git a/src/disk.c b/src/disk.c
index 8f8f370240ba2f99c48dcfdf2d0efe4b77d05521..b60fefa03bd1186aede7264bbc2d6e640ecd38e0 100644 (file)
--- a/src/disk.c
+++ b/src/disk.c
{
char *disk_name;
char *output_name;
- char *alt_name;
numfields = strsplit (buffer, fields, 32);
output_name = disk_name;
#if HAVE_LIBUDEV
- alt_name = disk_udev_attr_name (handle_udev, disk_name,
- conf_udev_name_attr);
-#else
- alt_name = NULL;
-#endif
+ char *alt_name = disk_udev_attr_name (handle_udev, disk_name, conf_udev_name_attr);
if (alt_name != NULL)
output_name = alt_name;
+#endif
if ((ds->read_bytes != 0) || (ds->write_bytes != 0))
disk_submit (output_name, "disk_octets",
submit_io_time (output_name, io_time, weighted_time);
} /* if (is_disk) */
+#if HAVE_LIBUDEV
/* release udev-based alternate name, if allocated */
- free(alt_name);
+ sfree (alt_name);
+#endif
} /* while (fgets (buffer, sizeof (buffer), fh) != NULL) */
#if HAVE_LIBUDEV