# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1239243762 14400
# Node ID 8d0ce3b79aaacde9a7b25d8e2fe2eb79878229ee
# Parent 2e7cebb8a166483d9997becd030666166631c301
Fix places where virDomainPtr aren't properly freed.
diff -r 2e7cebb8a166 -r 8d0ce3b79aaa src/Virt_KVMRedirectionSAP.c
--- a/src/Virt_KVMRedirectionSAP.c Wed Apr 01 14:50:09 2009 -0700
+++ b/src/Virt_KVMRedirectionSAP.c Wed Apr 08 22:22:42 2009 -0400
@@ -374,7 +374,7 @@
CMPIInstance **_inst)
{
virConnectPtr conn;
- virDomainPtr dom;
+ virDomainPtr dom = NULL;
CMPIStatus s = {CMPI_RC_OK, NULL};
CMPIInstance *inst = NULL;
struct domain *dominfo = NULL;
@@ -445,14 +445,13 @@
inst = get_console_sap(broker, ref, conn, port, &s);
- virDomainFree(dom);
-
if (s.rc != CMPI_RC_OK)
goto out;
*_inst = inst;
out:
+ virDomainFree(dom);
virConnectClose(conn);
if (port != NULL)
free(port->name);
diff -r 2e7cebb8a166 -r 8d0ce3b79aaa src/Virt_RASD.c
--- a/src/Virt_RASD.c Wed Apr 01 14:50:09 2009 -0700
+++ b/src/Virt_RASD.c Wed Apr 08 22:22:42 2009 -0400
@@ -63,12 +63,17 @@
struct virt_device **list)
{
virDomainPtr dom;
+ int count = 0;
dom = virDomainLookupByName(conn, host);
if (dom == NULL)
return 0;
- return get_devices(dom, list, type);
+ count = get_devices(dom, list, type);
+
+ virDomainFree(dom);
+
+ return count;
}
static struct virt_device *find_dev(virConnectPtr conn,
@@ -703,6 +708,7 @@
out:
virConnectClose(conn);
+ free(domains);
return s;
}