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>
void *opaque)
{
libxlDriverConfigPtr cfg;
- char *driverConf = NULL;
+ g_autofree char *driverConf = NULL;
char ebuf[1024];
bool autostart = true;
if (libxlDriverConfigLoadFile(cfg, driverConf) < 0)
goto error;
- VIR_FREE(driverConf);
/* Register the callbacks providing access to libvirt's event loop */
libxl_osevent_register_hooks(cfg->ctx, &libxl_osevent_callbacks, cfg->ctx);
return VIR_DRV_STATE_INIT_COMPLETE;
error:
- VIR_FREE(driverConf);
libxlStateCleanup();
return VIR_DRV_STATE_INIT_ERROR;
}