Re: [PATCH 03/17] Fix leak in virDomainVcpuPinDefParseXML parsing cpumask

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

 



On Tue, Sep 24, 2013 at 11:03 AM, Daniel P. Berrange
<berrange@xxxxxxxxxx> wrote:
> From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>
>
> If the virBitmapParse method fails due to OOM, we leak
> the 'tmp' variable string.
>
> Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>
> ---
>  src/conf/domain_conf.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
> index ccb61aa..aab6781 100644
> --- a/src/conf/domain_conf.c
> +++ b/src/conf/domain_conf.c
> @@ -10614,8 +10614,10 @@ virDomainVcpuPinDefParseXML(const xmlNodePtr node,
>          int cpumasklen = VIR_DOMAIN_CPUMASK_LEN;
>
>          if (virBitmapParse(set, 0, &def->cpumask,
> -                           cpumasklen) < 0)
> -           goto error;
> +                           cpumasklen) < 0) {
> +            VIR_FREE(tmp);
> +            goto error;
> +        }
>          VIR_FREE(tmp);
>      } else {
>          virReportError(VIR_ERR_INTERNAL_ERROR,
> --
> 1.8.3.1
>
> --
> libvir-list mailing list
> libvir-list@xxxxxxxxxx
> https://www.redhat.com/mailman/listinfo/libvir-list

ACK

-- 
Doug Goldstein

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