Re: [PATCH] conf: Don't free uninitialized pointer

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

 



On 04.11.2011 09:33, Jiri Denemark wrote:
> This causes libvirtd to crash when both <boot dev='...'/> and <boot
> order='...'/> are used in one domain XML. Introduced by
> 5fa3d775a9f8cdb3423373eb084219aaf778df11
> ---
>  src/conf/domain_conf.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
> index 238edfd..a85f837 100644
> --- a/src/conf/domain_conf.c
> +++ b/src/conf/domain_conf.c
> @@ -6430,7 +6430,8 @@ virDomainDefParseBootXML(xmlXPathContextPtr ctxt,
>  {
>      xmlNodePtr *nodes = NULL;
>      int i, n;
> -    char *bootstr, *useserial;
> +    char *bootstr;
> +    char *useserial = NULL;
>      int ret = -1;
>      unsigned long deviceBoot, serialPorts;
>  

ACK,

other solution would be to VIR_FREE(useserial) in if(useserial) {} like
we do for bootstr; But that is just cosmetic not a show stopper.

Michal

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