dmraid/dmraid-fdleak.patch

21 lines
976 B
Diff
Raw Normal View History

Index: libdmraid-events/libdmraid-events.c
===================================================================
--- libdmraid-events/libdmraid-events.c.orig 2008-07-18 23:30:05.000000000 +0200
+++ libdmraid-events/libdmraid-events.c 2009-10-03 14:55:34.000000000 +0200
@@ -180,6 +180,7 @@ static int _repopulate(const char* devic
}
fscanf(fd, "%s", curr->raid_mem[curr->num_sata_drives].major_minor);
fclose(fd);
+ closedir(dir);
curr->raid_mem[curr->num_sata_drives].port_num = atoi(dir_ent[i]->d_name);
syslog(LOG_INFO, "Added disk %s (%s) port=%i\n",
disk, curr->raid_mem[curr->num_sata_drives].major_minor, curr->raid_mem[curr->num_sata_drives].port_num);
@@ -969,6 +970,7 @@ int register_device(const char *device,
}
fscanf(fd, "%s", rv_next->raid_mem[m].major_minor);
fclose(fd);
+ closedir(dir);
rv_next->raid_mem[m].port_num = atoi(dir_ent[j]->d_name);
m++;
break;