projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
filecount plugin: malloc + memset -> calloc
[collectd.git]
/
src
/
disk.c
diff --git
a/src/disk.c
b/src/disk.c
index
8f8f370
..
b60fefa
100644
(file)
--- a/
src/disk.c
+++ b/
src/disk.c
@@
-681,7
+681,6
@@
static int disk_read (void)
{
char *disk_name;
char *output_name;
{
char *disk_name;
char *output_name;
- char *alt_name;
numfields = strsplit (buffer, fields, 32);
numfields = strsplit (buffer, fields, 32);
@@
-841,13
+840,10
@@
static int disk_read (void)
output_name = disk_name;
#if HAVE_LIBUDEV
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;
if (alt_name != NULL)
output_name = alt_name;
+#endif
if ((ds->read_bytes != 0) || (ds->write_bytes != 0))
disk_submit (output_name, "disk_octets",
if ((ds->read_bytes != 0) || (ds->write_bytes != 0))
disk_submit (output_name, "disk_octets",
@@
-869,8
+865,10
@@
static int disk_read (void)
submit_io_time (output_name, io_time, weighted_time);
} /* if (is_disk) */
submit_io_time (output_name, io_time, weighted_time);
} /* if (is_disk) */
+#if HAVE_LIBUDEV
/* release udev-based alternate name, if allocated */
/* release udev-based alternate name, if allocated */
- free(alt_name);
+ sfree (alt_name);
+#endif
} /* while (fgets (buffer, sizeof (buffer), fh) != NULL) */
#if HAVE_LIBUDEV
} /* while (fgets (buffer, sizeof (buffer), fh) != NULL) */
#if HAVE_LIBUDEV