+Mon Jul 21 11:47:08 CEST 2008 Daniel Veillard <veillard@redhat.com>
+
+ * src/xen_unified.c: fix a leak in xenUnifiedOpen
+
Mon Jul 21 10:07:08 CEST 2008 Daniel Veillard <veillard@redhat.com>
* src/openvz_driver.c: patch from Evgeniy Sokolov to get OpenVZ
static int
xenUnifiedOpen (virConnectPtr conn, xmlURIPtr uri, virConnectAuthPtr auth, int flags)
{
- int i;
+ int i, ret = VIR_DRV_OPEN_DECLINED;
xenUnifiedPrivatePtr priv;
/* Refuse any scheme which isn't "xen://" or "http://". */
}
#else
DEBUG0("Handing off for remote driver");
- return VIR_DRV_OPEN_DECLINED; /* Let remote_driver try instead */
+ ret = VIR_DRV_OPEN_DECLINED; /* Let remote_driver try instead */
+ goto clean;
#endif
}
}
return VIR_DRV_OPEN_SUCCESS;
- fail:
+fail:
+ ret = VIR_DRV_OPEN_ERROR;
+clean:
DEBUG0("Failed to activate a mandatory sub-driver");
for (i = 0 ; i < XEN_UNIFIED_NR_DRIVERS ; i++)
if (priv->opened[i]) drivers[i]->close(conn);
VIR_FREE(priv);
- return VIR_DRV_OPEN_ERROR;
+ return ret
}
#define GET_PRIVATE(conn) \