From 8a493c4ebb872a93fbe337639d5e58ab70694f37 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 8 Jun 2011 22:27:01 +0100 Subject: [PATCH] Coverity: Close directory handle along error paths. (cherry picked from commit 7c020a14802255c966b2b402b983551b86a08bba) --- daemon/devsparts.c | 2 ++ 1 file changed, 2 insertions(+) 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.8.3.1