* src/xen_unified.c: fix a leak in xenUnifiedOpen

Daniel
This commit is contained in:
Daniel Veillard 2008-07-21 09:48:01 +00:00
parent 7b4f67acea
commit 403a5163c9
2 changed files with 11 additions and 4 deletions

View File

@ -1,3 +1,7 @@
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

View File

@ -239,7 +239,7 @@ xenUnifiedProbe (void)
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://". */
@ -329,19 +329,22 @@ xenUnifiedOpen (virConnectPtr conn, xmlURIPtr uri, virConnectAuthPtr auth, int f
}
#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) \