From fffb1226aa016ab16d92acd9b5d449ca894ed7a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1n=20Tomko?= Date: Sat, 22 Feb 2020 13:02:27 +0100 Subject: [PATCH] libxl: StateInitialize: use g_autofree MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use g_autofree to free the driver config file path. Signed-off-by: Ján Tomko Reviewed-by: Jim Fehlig --- 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 8f855891d0..5de3bcd2a6 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -653,7 +653,7 @@ libxlStateInitialize(bool privileged, void *opaque) { libxlDriverConfigPtr cfg; - char *driverConf = NULL; + g_autofree char *driverConf = NULL; char ebuf[1024]; bool autostart = true; @@ -707,7 +707,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); @@ -823,7 +822,6 @@ libxlStateInitialize(bool privileged, return VIR_DRV_STATE_INIT_COMPLETE; error: - VIR_FREE(driverConf); libxlStateCleanup(); return VIR_DRV_STATE_INIT_ERROR; } -- GitLab