]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
usbFindBusByVendor: don't leak a DIR buffer and FD
authorJim Meyering <meyering@redhat.com>
Mon, 25 Jan 2010 15:36:07 +0000 (16:36 +0100)
committerJim Meyering <meyering@redhat.com>
Mon, 25 Jan 2010 15:50:28 +0000 (16:50 +0100)
* src/util/hostusb.c (usbFindBusByVendor): Don't leak a DIR buffer
and file descriptor.

src/util/hostusb.c

index 8fbb48673cded5d398300efc7cbe59050cd357a5..9a37103caf3a0ad76e09a28e80e4d5b7789c927d 100644 (file)
@@ -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;
 }