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

[dm-devel] [PATCH libdmraid-events 1/3] Add some missing closedir calls.



Two times opendir is called without a matching
closedir - so add those calls.

Signed-off-by: NeilBrown <neilb suse de>
---
 libdmraid-events.c |    2 ++
 1 file changed, 2 insertions(+)

--- 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);


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