[PATCH 2/2] super-intel.c: Fix resource leak from opendir()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


From: Jes Sorensen <Jes.Sorensen@xxxxxxxxxx>

Use closedir() on dirp from opendir() to avoid resource leaking.

Signed-off-by: Jes Sorensen <Jes.Sorensen@xxxxxxxxxx>
---
 super-intel.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/super-intel.c b/super-intel.c
index ca15703..e2ed95a 100644
--- a/super-intel.c
+++ b/super-intel.c
@@ -5686,6 +5686,7 @@ get_devices(const char *hba_path)
 			free(dv);
 		}
 	}
+	closedir(dir);
 	return devlist;
 }
 
-- 
1.7.7.6

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[ATA RAID]     [Linux SCSI Target Infrastructure]     [Managing RAID on Linux]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device-Mapper]     [Kernel]     [Linux Books]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Photos]     [Yosemite Photos]     [Yosemite News]     [AMD 64]     [Linux Networking]

Add to Google Powered by Linux