[Libguestfs] [PATCH 09/13] Coverity: Close directory handle along error paths.
Richard W.M. Jones
rjones at redhat.com
Thu Jun 9 10:17:08 UTC 2011
---
daemon/devsparts.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/daemon/devsparts.c b/daemon/devsparts.c
index c8f0256..52a6d30 100644
--- a/daemon/devsparts.c
+++ b/daemon/devsparts.c
@@ -89,6 +89,7 @@ foreach_block_device (block_dev_func_t func)
if(0 != errno) {
reply_with_perror ("readdir: /sys/block");
free_stringslen(r, size);
+ closedir (dir);
return NULL;
}
@@ -175,6 +176,7 @@ add_partitions(const char *device,
if(0 != errno) {
reply_with_perror ("readdir: %s", devdir);
free_stringslen(*r, *size);
+ closedir (dir);
return -1;
}
--
1.7.5.1
More information about the Libguestfs
mailing list