From: jazzmes Date: Thu, 31 Jul 2014 17:08:54 +0000 (-0700) Subject: Fixed memory leaks X-Git-Tag: collectd-5.5.0~237^2 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=6db2e260ac76982456e35f18226c09541f472e41;p=collectd.git Fixed memory leaks Fixed memory leaks --- 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); }