From 6db2e260ac76982456e35f18226c09541f472e41 Mon Sep 17 00:00:00 2001 From: jazzmes Date: Thu, 31 Jul 2014 10:08:54 -0700 Subject: [PATCH] Fixed memory leaks Fixed memory leaks --- src/libvirt.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libvirt.c b/src/libvirt.c index 849cfe22..8eec9aaf 100644 --- 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); + sfree (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); } -- 2.30.2