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

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

 



On Wed, Mar 14, 2018 at 03:26:08AM +0100, Marek Marczykowski-Górecki wrote:
> 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>
> ---
> 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(-)

Reviewed-by: Daniel P. Berrangé <berrange@xxxxxxxxxx>


> 
> diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
> index 970cff2..2d2a707 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

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

--
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