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

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

 



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

Signed-off-by: NeilBrown <neilb@xxxxxxx>
---
 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);

--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/dm-devel

[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux