Use g_autofree to free the driver config file path.
Signed-off-by: Ján Tomko <jtomko(a)redhat.com>
---
src/libxl/libxl_driver.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index 2b06f1be1e..0b88c9f9d9 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -652,7 +652,7 @@ libxlStateInitialize(bool privileged,
void *opaque)
{
libxlDriverConfigPtr cfg;
- char *driverConf = NULL;
+ g_autofree char *driverConf = NULL;
char ebuf[1024];
bool autostart = true;
@@ -706,7 +706,6 @@ libxlStateInitialize(bool privileged,
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);
@@ -822,7 +821,6 @@ libxlStateInitialize(bool privileged,
return VIR_DRV_STATE_INIT_COMPLETE;
error:
- VIR_FREE(driverConf);
libxlStateCleanup();
return VIR_DRV_STATE_INIT_ERROR;
}
--
2.24.1