mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-18 10:35:20 +00:00
libxl: StateInitialize: use g_autofree
Use g_autofree to free the driver config file path. Signed-off-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Jim Fehlig <jfehlig@suse.com>
This commit is contained in:
parent
af0d94468c
commit
fffb1226aa
@ -653,7 +653,7 @@ libxlStateInitialize(bool privileged,
|
|||||||
void *opaque)
|
void *opaque)
|
||||||
{
|
{
|
||||||
libxlDriverConfigPtr cfg;
|
libxlDriverConfigPtr cfg;
|
||||||
char *driverConf = NULL;
|
g_autofree char *driverConf = NULL;
|
||||||
char ebuf[1024];
|
char ebuf[1024];
|
||||||
bool autostart = true;
|
bool autostart = true;
|
||||||
|
|
||||||
@ -707,7 +707,6 @@ libxlStateInitialize(bool privileged,
|
|||||||
|
|
||||||
if (libxlDriverConfigLoadFile(cfg, driverConf) < 0)
|
if (libxlDriverConfigLoadFile(cfg, driverConf) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
VIR_FREE(driverConf);
|
|
||||||
|
|
||||||
/* Register the callbacks providing access to libvirt's event loop */
|
/* Register the callbacks providing access to libvirt's event loop */
|
||||||
libxl_osevent_register_hooks(cfg->ctx, &libxl_osevent_callbacks, cfg->ctx);
|
libxl_osevent_register_hooks(cfg->ctx, &libxl_osevent_callbacks, cfg->ctx);
|
||||||
@ -823,7 +822,6 @@ libxlStateInitialize(bool privileged,
|
|||||||
return VIR_DRV_STATE_INIT_COMPLETE;
|
return VIR_DRV_STATE_INIT_COMPLETE;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
VIR_FREE(driverConf);
|
|
||||||
libxlStateCleanup();
|
libxlStateCleanup();
|
||||||
return VIR_DRV_STATE_INIT_ERROR;
|
return VIR_DRV_STATE_INIT_ERROR;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user