On 10/4/20 4:21 PM, Ján Tomko wrote:
Signed-off-by: Ján Tomko <jto...@redhat.com>
---
src/libxl/libxl_domain.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
Reviewed-by: Jim Fehlig <jfeh...@suse.com>
Regards,
Jim
diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c
index 034be2ddd7..b49ca83c10 100644
--- a/src/libxl/libxl_domain.c
+++ b/src/libxl/libxl_domain.c
@@ -1266,16 +1266,16 @@ libxlDomainStart(libxlDriverPrivatePtr driver,
libxlSavefileHeader hdr;
int ret = -1;
uint32_t domid = 0;
- char *dom_xml = NULL;
+ g_autofree char *dom_xml = NULL;
g_autofree char *managed_save_path = NULL;
- int managed_save_fd = -1;
+ VIR_AUTOCLOSE managed_save_fd = -1;
libxlDomainObjPrivatePtr priv = vm->privateData;
g_autoptr(libxlDriverConfig) cfg = libxlDriverConfigGet(driver);
virHostdevManagerPtr hostdev_mgr = driver->hostdevMgr;
libxl_asyncprogress_how aop_console_how;
libxl_domain_restore_params params;
unsigned int hostdev_flags = VIR_HOSTDEV_SP_PCI;
- char *config_json = NULL;
+ g_autofree char *config_json = NULL;
#ifdef LIBXL_HAVE_PVUSB
hostdev_flags |= VIR_HOSTDEV_SP_USB;
@@ -1516,9 +1516,6 @@ libxlDomainStart(libxlDriverPrivatePtr driver,
cleanup:
libxl_domain_config_dispose(&d_config);
- VIR_FREE(config_json);
- VIR_FREE(dom_xml);
- VIR_FORCE_CLOSE(managed_save_fd);
return ret;
}