mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-12 15:52:55 +00:00
libxl: Don't free domain death event
Callers should not free death events provided by libxl_evdisable_FOO().
This commit is contained in:
parent
f426ab08fb
commit
7459cae9b0
@ -270,7 +270,6 @@ libxlDomainObjPrivateAlloc(void)
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
libxl_ctx_alloc(&priv->ctx, LIBXL_VERSION, 0, libxl_driver->logger);
|
libxl_ctx_alloc(&priv->ctx, LIBXL_VERSION, 0, libxl_driver->logger);
|
||||||
priv->deathW = NULL;
|
|
||||||
libxl_osevent_register_hooks(priv->ctx, &libxl_event_callbacks, priv);
|
libxl_osevent_register_hooks(priv->ctx, &libxl_event_callbacks, priv);
|
||||||
|
|
||||||
return priv;
|
return priv;
|
||||||
@ -281,10 +280,8 @@ libxlDomainObjPrivateFree(void *data)
|
|||||||
{
|
{
|
||||||
libxlDomainObjPrivatePtr priv = data;
|
libxlDomainObjPrivatePtr priv = data;
|
||||||
|
|
||||||
if (priv->deathW) {
|
if (priv->deathW)
|
||||||
libxl_evdisable_domain_death(priv->ctx, priv->deathW);
|
libxl_evdisable_domain_death(priv->ctx, priv->deathW);
|
||||||
VIR_FREE(priv->deathW);
|
|
||||||
}
|
|
||||||
|
|
||||||
libxl_ctx_free(priv->ctx);
|
libxl_ctx_free(priv->ctx);
|
||||||
VIR_FREE(priv);
|
VIR_FREE(priv);
|
||||||
@ -604,9 +601,10 @@ libxlCreateDomEvents(virDomainObjPtr vm)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
if (priv->deathW)
|
if (priv->deathW) {
|
||||||
libxl_evdisable_domain_death(priv->ctx, priv->deathW);
|
libxl_evdisable_domain_death(priv->ctx, priv->deathW);
|
||||||
VIR_FREE(priv->deathW);
|
priv->deathW = NULL;
|
||||||
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user