mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-12 07:42:56 +00:00
libxl: Check for libxl_ctx_alloc failure
This commit is contained in:
parent
7459cae9b0
commit
52947fe3ae
@ -269,7 +269,12 @@ libxlDomainObjPrivateAlloc(void)
|
||||
if (VIR_ALLOC(priv) < 0)
|
||||
return NULL;
|
||||
|
||||
libxl_ctx_alloc(&priv->ctx, LIBXL_VERSION, 0, libxl_driver->logger);
|
||||
if (libxl_ctx_alloc(&priv->ctx, LIBXL_VERSION, 0, libxl_driver->logger)) {
|
||||
VIR_ERROR(_("Failed libxl context initialization"));
|
||||
VIR_FREE(priv);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
libxl_osevent_register_hooks(priv->ctx, &libxl_event_callbacks, priv);
|
||||
|
||||
return priv;
|
||||
|
Loading…
x
Reference in New Issue
Block a user