---
src/libxl/libxl_driver.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index 61ceae1..baa05e8 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -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;
--
1.8.0.1