[PATCH v7 1/9] libxl: fix libxlDriverConfigDispose for partially constructed object

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



libxlDriverConfigNew() use libxlDriverConfigDispose() for cleanup in
case of errors. Do not call libxlLoggerFree() on not allocated logger
(NULL).

Signed-off-by: Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>
Reviewed-by: Jim Fehlig <jfehlig@xxxxxxxx>
Reviewed-by: Daniel P. Berrangé <berrange@xxxxxxxxxx>
---
Changes since v3:
 - new patch, mostly unrelated, but found while adjusting tests
---
 src/libxl/libxl_conf.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
index df1cece..ae369bc 100644
--- a/src/libxl/libxl_conf.c
+++ b/src/libxl/libxl_conf.c
@@ -80,7 +80,8 @@ libxlDriverConfigDispose(void *obj)
 
     virObjectUnref(cfg->caps);
     libxl_ctx_free(cfg->ctx);
-    libxlLoggerFree(cfg->logger);
+    if (cfg->logger)
+        libxlLoggerFree(cfg->logger);
 
     VIR_FREE(cfg->configDir);
     VIR_FREE(cfg->autostartDir);
-- 
git-series 0.9.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux