[libvirt] [PATCH] Fix more reference leaks for node devices

Eric Blake eblake at redhat.com
Fri Jun 25 22:12:13 UTC 2010


On 06/25/2010 04:02 PM, Matthias Bolte wrote:
> Reported by Chris Lalancette, I just found more instances
> of the same pattern.
> ---
>  daemon/remote.c |    8 ++++++++
>  1 files changed, 8 insertions(+), 0 deletions(-)
> 
> diff --git a/daemon/remote.c b/daemon/remote.c
> index ec5f85b..cb9e83d 100644
> --- a/daemon/remote.c
> +++ b/daemon/remote.c
> @@ -5126,10 +5126,12 @@ remoteDispatchNodeDeviceDettach (struct qemud_server *server ATTRIBUTE_UNUSED,
>      }
>  
>      if (virNodeDeviceDettach(dev) == -1) {
> +        virNodeDeviceFree(dev);
>          remoteDispatchConnError(rerr, conn);
>          return -1;
>      }
>  
> +    virNodeDeviceFree(dev);
>      return 0;

ACK, but again the same comment that if Chris' patch is changed to use a
goto cleanup idiom, then this one should as well.

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20100625/db8bc2bd/attachment-0001.sig>


More information about the libvir-list mailing list