diff mbox

[libdmraid-events,1/3] Add some missing closedir calls.

Message ID 20091211032402.781887148@suse.de (mailing list archive)
State New, archived
Headers show

Commit Message

NeilBrown Dec. 11, 2009, 3:22 a.m. UTC
None
diff mbox

Patch

--- libdmraid-events.orig/libdmraid-events.c
+++ libdmraid-events/libdmraid-events.c
@@ -172,6 +172,7 @@  static int _repopulate(const char* devic
 						memcpy(test_path+strlen(sys_path), strchr(disk+1, '/')+1, strlen(strchr(disk+1, '/')+1));
 						if((dir = opendir(test_path)))
 						{
+							closedir(dir);
 							/* test path is for this raid volume */
 							memcpy(test_path+strlen(test_path), "/dev", 4);
 							if(!(fd = fopen(test_path, "r"))) {
@@ -959,6 +960,7 @@  int register_device(const char *device, 
 					if(!(dir = opendir(test_path)))
 						continue;
 					else {
+						closedir(dir);
 						/* test path is for this raid volume */
 						memcpy(rv_next->raid_mem[m].dev_name, scsi_dev, strlen(scsi_dev));
 						memset(rv_next->raid_mem[m].dev_name+strlen(scsi_dev), 0, 1);