mirror of https://gitee.com/openkylin/libvirt.git
libxl: fix libxlDriverConfigDispose for partially constructed object
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@invisiblethingslab.com> Reviewed-by: Jim Fehlig <jfehlig@suse.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
5ecccf9d27
commit
13019ba8e1
|
@ -80,7 +80,8 @@ libxlDriverConfigDispose(void *obj)
|
||||||
|
|
||||||
virObjectUnref(cfg->caps);
|
virObjectUnref(cfg->caps);
|
||||||
libxl_ctx_free(cfg->ctx);
|
libxl_ctx_free(cfg->ctx);
|
||||||
libxlLoggerFree(cfg->logger);
|
if (cfg->logger)
|
||||||
|
libxlLoggerFree(cfg->logger);
|
||||||
|
|
||||||
VIR_FREE(cfg->configDir);
|
VIR_FREE(cfg->configDir);
|
||||||
VIR_FREE(cfg->autostartDir);
|
VIR_FREE(cfg->autostartDir);
|
||||||
|
|
Loading…
Reference in New Issue