projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
627a050
)
Fixed memory leaks
author
jazzmes
<tcarvalho@cmu.edu>
Thu, 31 Jul 2014 17:08:54 +0000
(10:08 -0700)
committer
jazzmes
<tcarvalho@cmu.edu>
Thu, 31 Jul 2014 17:08:54 +0000
(10:08 -0700)
Fixed memory leaks
src/libvirt.c
patch
|
blob
|
history
diff --git
a/src/libvirt.c
b/src/libvirt.c
index
849cfe2
..
8eec9aa
100644
(file)
--- a/
src/libvirt.c
+++ b/
src/libvirt.c
@@
-479,7
+479,7
@@
lv_read (void)
{
ERROR ("libvirt plugin: virDomainGetVcpus failed with status %i.",
status);
- free (vinfo);
+
s
free (vinfo);
continue;
}
@@
-487,6
+487,7
@@
lv_read (void)
vcpu_submit (vinfo[j].cpuTime,
domains[i], vinfo[j].number, "virt_vcpu");
+ sfree (vinfo);
minfo = malloc (VIR_DOMAIN_MEMORY_STAT_NR * sizeof (virDomainMemoryStatStruct));
if (minfo == NULL) {
@@
-499,6
+500,7
@@
lv_read (void)
if (status < 0) {
ERROR ("libvirt plugin: virDomainMemoryStats failed with status %i.",
status);
+ sfree (minfo);
continue;
}
@@
-507,7
+509,6
@@
lv_read (void)
}
sfree (minfo);
- sfree (vinfo);
}