[libvirt] [PATCH] usbFindBusByVendor: don't leak a DIR buffer and FD

Daniel Veillard veillard at redhat.com
Mon Jan 25 15:52:46 UTC 2010


On Mon, Jan 25, 2010 at 04:37:43PM +0100, Jim Meyering wrote:
> I know better than to say this is so simple/obvious that
> it doesn't need review, but I'm tempted...
> 
> >From 02c7dfa830544bbafd62867fc70b3aba7cc07385 Mon Sep 17 00:00:00 2001
> From: Jim Meyering <meyering at redhat.com>
> Date: Mon, 25 Jan 2010 16:36:07 +0100
> Subject: [PATCH] usbFindBusByVendor: don't leak a DIR buffer and FD
> 
> * src/util/hostusb.c (usbFindBusByVendor): Don't leak a DIR buffer
> and file descriptor.
> ---
>  src/util/hostusb.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/src/util/hostusb.c b/src/util/hostusb.c
> index 8fbb486..9a37103 100644
> --- a/src/util/hostusb.c
> +++ b/src/util/hostusb.c
> @@ -1,5 +1,5 @@
>  /*
> - * Copyright (C) 2009 Red Hat, Inc.
> + * Copyright (C) 2009-2010 Red Hat, Inc.
>   *
>   * This library is free software; you can redistribute it and/or
>   * modify it under the terms of the GNU Lesser General Public
> @@ -151,6 +151,7 @@ static int usbFindBusByVendor(virConnectPtr conn,
>          ret = 0;
> 
>  error:
> +    closedir (dir);
>      return ret;
>  }

  Ah right ! ACK

Daniel

-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel at veillard.com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/




More information about the libvir-list mailing list