From: Jim Fehlig Date: Thu, 17 Feb 2022 18:48:13 +0000 (-0700) Subject: libxl: Fix libvirtd crash on domain restore X-Git-Tag: v8.1.0-rc1~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=454b927d1e33a1fe9dca535db2c97300fdae62cc;p=thirdparty%2Flibvirt.git libxl: Fix libvirtd crash on domain restore Commit cc2a3c2a94 missed one case in the libxl driver where virDomainDef is returned from libxlDomainSaveImageOpen and a g_steal_pointer is needed. Without it, the virDomainDef object is freed and the driver crashes later in the restore process when accessing the object. Signed-off-by: Jim Fehlig Reviewed-by: Ján Tomko --- diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c index c91e531a9a..ee031267ca 100644 --- a/src/libxl/libxl_domain.c +++ b/src/libxl/libxl_domain.c @@ -811,7 +811,7 @@ libxlDomainSaveImageOpen(libxlDriverPrivate *driver, VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE))) goto error; - *ret_def = def; + *ret_def = g_steal_pointer(&def); *ret_hdr = hdr; return fd;