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

Re: [libvirt] [PATCH 11/23] Fix leak of iterators in virDBusMessageIterEncode



On 09/25/2013 08:51 AM, Daniel P. Berrange wrote:
> From: "Daniel P. Berrange" <berrange redhat com>
> 
> If virDBusMessageIterEncode hits an OOM condition it often
> leaks the memory associated with the dbus iterator object
> 
> Signed-off-by: Daniel P. Berrange <berrange redhat com>
> ---

>  
>  cleanup:
> +    while (nstack > 0) {
> +        DBusMessageIter *thisiter = iter;
> +        VIR_DEBUG("Popping iter=%p", iter);
> +        if (virDBusTypeStackPop(&stack, &nstack, &iter,
> +                                &types, &nstruct, &narray) < 0)
> +            goto cleanup;

I'm worried that this will infloop.  What guarantee do we have that
nstack reduces when virDBusTypeStackPop fails?

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


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