[libvirt] [PATCH 01/17] Fix leak in virDomainVcpuPinDefArrayFree

Doug Goldstein cardoe at gentoo.org
Tue Sep 24 19:52:18 UTC 2013


On Tue, Sep 24, 2013 at 11:03 AM, Daniel P. Berrange
<berrange at redhat.com> wrote:
> From: "Daniel P. Berrange" <berrange at redhat.com>
>
> If virDomainVcpuPinDefArrayFree is called with def != NULL,
> but nvcpupin == 0, then it leaks memory for 'def'. This is
> an unusual scenario, but it hits when cleaning up after an
> OOM during parsing of XML.
>
> Signed-off-by: Daniel P. Berrange <berrange at redhat.com>
> ---
>  src/conf/domain_conf.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
> index 240f318..81314bc 100644
> --- a/src/conf/domain_conf.c
> +++ b/src/conf/domain_conf.c
> @@ -1853,7 +1853,7 @@ virDomainVcpuPinDefArrayFree(virDomainVcpuPinDefPtr *def,
>  {
>      size_t i;
>
> -    if (!def || !nvcpupin)
> +    if (!def)
>          return;
>
>      for (i = 0; i < nvcpupin; i++) {
> --
> 1.8.3.1
>

ACK.

-- 
Doug Goldstein




More information about the libvir-list mailing list