projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
7f8e1ac
)
libvirt plugin: Use "sfree" rather than "free".
author
Florian Forster
<octo@leeloo.lan.home.verplant.org>
Tue, 1 Jun 2010 14:17:47 +0000
(16:17 +0200)
committer
Florian Forster
<octo@leeloo.lan.home.verplant.org>
Tue, 1 Jun 2010 14:17:47 +0000
(16:17 +0200)
src/libvirt.c
patch
|
blob
|
history
diff --git
a/src/libvirt.c
b/src/libvirt.c
index
6732656
..
44f3832
100644
(file)
--- a/
src/libvirt.c
+++ b/
src/libvirt.c
@@
-225,7
+225,7
@@
lv_config (const char *key, const char *value)
n = strsplit (value_copy, fields, HF_MAX_FIELDS);
if (n < 1) {
n = strsplit (value_copy, fields, HF_MAX_FIELDS);
if (n < 1) {
- free (value_copy);
+
s
free (value_copy);
ERROR ("HostnameFormat: no fields");
return -1;
}
ERROR ("HostnameFormat: no fields");
return -1;
}
@@
-238,12
+238,12
@@
lv_config (const char *key, const char *value)
else if (strcasecmp (fields[i], "uuid") == 0)
hostname_format[i] = hf_uuid;
else {
else if (strcasecmp (fields[i], "uuid") == 0)
hostname_format[i] = hf_uuid;
else {
- free (value_copy);
+
s
free (value_copy);
ERROR ("unknown HostnameFormat field: %s", fields[i]);
return -1;
}
}
ERROR ("unknown HostnameFormat field: %s", fields[i]);
return -1;
}
}
- free (value_copy);
+
s
free (value_copy);
for (i = n; i < HF_MAX_FIELDS; ++i)
hostname_format[i] = hf_none;
for (i = n; i < HF_MAX_FIELDS; ++i)
hostname_format[i] = hf_none;
@@
-332,7
+332,7
@@
lv_read (void)
if (virDomainGetVcpus (domains[i], vinfo, info.nrVirtCpu,
NULL, 0) != 0) {
if (virDomainGetVcpus (domains[i], vinfo, info.nrVirtCpu,
NULL, 0) != 0) {
- free (vinfo);
+
s
free (vinfo);
continue;
}
continue;
}
@@
-340,7
+340,7
@@
lv_read (void)
vcpu_submit (vinfo[j].cpuTime,
t, domains[i], vinfo[j].number, "virt_vcpu");
vcpu_submit (vinfo[j].cpuTime,
t, domains[i], vinfo[j].number, "virt_vcpu");
- free (vinfo);
+
s
free (vinfo);
}
/* Get block device stats for each domain. */
}
/* Get block device stats for each domain. */
@@
-424,7
+424,7
@@
refresh_lists (void)
n = virConnectListDomains (conn, domids, n);
if (n < 0) {
VIRT_ERROR (conn, "reading list of domains");
n = virConnectListDomains (conn, domids, n);
if (n < 0) {
VIRT_ERROR (conn, "reading list of domains");
- free (domids);
+
s
free (domids);
return -1;
}
return -1;
}
@@
-552,10
+552,10
@@
refresh_lists (void)
if (xpath_obj) xmlXPathFreeObject (xpath_obj);
if (xpath_ctx) xmlXPathFreeContext (xpath_ctx);
if (xml_doc) xmlFreeDoc (xml_doc);
if (xpath_obj) xmlXPathFreeObject (xpath_obj);
if (xpath_ctx) xmlXPathFreeContext (xpath_ctx);
if (xml_doc) xmlFreeDoc (xml_doc);
-
if (xml)
free (xml);
+
s
free (xml);
}
}
- free (domids);
+
s
free (domids);
}
return 0;
}
return 0;
@@
-569,7
+569,7
@@
free_domains ()
if (domains) {
for (i = 0; i < nr_domains; ++i)
virDomainFree (domains[i]);
if (domains) {
for (i = 0; i < nr_domains; ++i)
virDomainFree (domains[i]);
- free (domains);
+
s
free (domains);
}
domains = NULL;
nr_domains = 0;
}
domains = NULL;
nr_domains = 0;
@@
-601,8
+601,8
@@
free_block_devices ()
if (block_devices) {
for (i = 0; i < nr_block_devices; ++i)
if (block_devices) {
for (i = 0; i < nr_block_devices; ++i)
- free (block_devices[i].path);
- free (block_devices);
+
s
free (block_devices[i].path);
+
s
free (block_devices);
}
block_devices = NULL;
nr_block_devices = 0;
}
block_devices = NULL;
nr_block_devices = 0;
@@
-625,7
+625,7
@@
add_block_device (virDomainPtr dom, const char *path)
new_ptr = malloc (new_size);
if (new_ptr == NULL) {
new_ptr = malloc (new_size);
if (new_ptr == NULL) {
- free (path_copy);
+
s
free (path_copy);
return -1;
}
block_devices = new_ptr;
return -1;
}
block_devices = new_ptr;
@@
-641,10
+641,10
@@
free_interface_devices ()
if (interface_devices) {
for (i = 0; i < nr_interface_devices; ++i) {
if (interface_devices) {
for (i = 0; i < nr_interface_devices; ++i) {
- free (interface_devices[i].path);
- free (interface_devices[i].address);
+
s
free (interface_devices[i].path);
+
s
free (interface_devices[i].address);
}
}
- free (interface_devices);
+
s
free (interface_devices);
}
interface_devices = NULL;
nr_interface_devices = 0;
}
interface_devices = NULL;
nr_interface_devices = 0;
@@
-669,8
+669,8
@@
add_interface_device (virDomainPtr dom, const char *path, const char *address)
new_ptr = malloc (new_size);
if (new_ptr == NULL) {
new_ptr = malloc (new_size);
if (new_ptr == NULL) {
- free (path_copy);
- free (address_copy);
+
s
free (path_copy);
+
s
free (address_copy);
return -1;
}
interface_devices = new_ptr;
return -1;
}
interface_devices = new_ptr;
@@
-694,7
+694,7
@@
ignore_device_match (ignorelist_t *il, const char *domname, const char *devpath)
}
ssnprintf (name, n, "%s:%s", domname, devpath);
r = ignorelist_match (il, name);
}
ssnprintf (name, n, "%s:%s", domname, devpath);
r = ignorelist_match (il, name);
- free (name);
+
s
free (name);
return r;
}
return r;
}