
# HG changeset patch # User Kaitlin Rupert <karupert@us.ibm.com> # Date 1238622609 25200 # Node ID 2e7cebb8a166483d9997becd030666166631c301 # Parent 58ebddb9670798102bf8fcd4d47a6137b0779571 Fix spots where virConnectPtr isn't being closed properly Signed-off-by: Kaitlin Rupert <karupert@us.ibm.com> diff -r 58ebddb96707 -r 2e7cebb8a166 src/Virt_KVMRedirectionSAP.c --- a/src/Virt_KVMRedirectionSAP.c Wed Apr 08 22:12:21 2009 -0400 +++ b/src/Virt_KVMRedirectionSAP.c Wed Apr 01 14:50:09 2009 -0700 @@ -269,7 +269,7 @@ struct inst_list *list) { CMPIStatus s = {CMPI_RC_OK, NULL}; - virConnectPtr conn; + virConnectPtr conn = NULL; virDomainPtr *domain_list; struct domain *dominfo = NULL; struct vnc_ports port_list; @@ -364,6 +364,7 @@ } free(port_list.list); + virConnectClose(conn); return s; } diff -r 58ebddb96707 -r 2e7cebb8a166 src/Virt_SettingsDefineCapabilities.c --- a/src/Virt_SettingsDefineCapabilities.c Wed Apr 08 22:12:21 2009 -0400 +++ b/src/Virt_SettingsDefineCapabilities.c Wed Apr 01 14:50:09 2009 -0700 @@ -374,6 +374,7 @@ ret = true; out: + virConnectClose(conn); return ret; } @@ -702,7 +703,7 @@ bool ret = false; const char *inst_id; CMPIrc prop_ret; - virConnectPtr conn; + virConnectPtr conn = NULL; CMPIInstance *pool_inst; if (cu_get_str_path(ref, "InstanceID", &inst_id) != CMPI_RC_OK) { @@ -738,6 +739,7 @@ ret = true; out: + virConnectClose(conn); return ret; } diff -r 58ebddb96707 -r 2e7cebb8a166 src/Virt_VSSD.c --- a/src/Virt_VSSD.c Wed Apr 08 22:12:21 2009 -0400 +++ b/src/Virt_VSSD.c Wed Apr 01 14:50:09 2009 -0700 @@ -238,6 +238,7 @@ out: free(list); + virConnectClose(conn); return s; } diff -r 58ebddb96707 -r 2e7cebb8a166 src/Virt_VirtualSystemManagementService.c --- a/src/Virt_VirtualSystemManagementService.c Wed Apr 08 22:12:21 2009 -0400 +++ b/src/Virt_VirtualSystemManagementService.c Wed Apr 01 14:50:09 2009 -0700 @@ -969,7 +969,7 @@ CMPI_RC_ERR_FAILED, conn, "Failed to define domain"); - return NULL; + goto out; } name = virDomainGetName(dom); @@ -982,6 +982,7 @@ "Failed to lookup resulting system"); } + out: virDomainFree(dom); virConnectClose(conn);