diff options
Diffstat (limited to 'sys-libs/libnvme/files/libnvme-1.5-free-segfault.patch')
-rw-r--r-- | sys-libs/libnvme/files/libnvme-1.5-free-segfault.patch | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/sys-libs/libnvme/files/libnvme-1.5-free-segfault.patch b/sys-libs/libnvme/files/libnvme-1.5-free-segfault.patch deleted file mode 100644 index a41cf380f911..000000000000 --- a/sys-libs/libnvme/files/libnvme-1.5-free-segfault.patch +++ /dev/null @@ -1,36 +0,0 @@ -From c56910f807795528fff7ba6b81f8efcdb4babe98 Mon Sep 17 00:00:00 2001 -From: Martin Belanger <martin.belanger@dell.com> -Date: Wed, 5 Jul 2023 10:59:25 -0400 -Subject: [PATCH] tree: missing closedir() causes fd leak for - "/sys/bus/pci/slots" - -In nvme_ctrl_lookup_phy_slot(), we are missing a closedir(), which -causes file descriptors to leak. Also, there was a missing free() -when the function returns with ENOMEM. - -Signed-off-by: Martin Belanger <martin.belanger@dell.com> ---- - src/nvme/tree.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/src/nvme/tree.c b/src/nvme/tree.c -index a2ac0698..805eff99 100644 ---- a/src/nvme/tree.c -+++ b/src/nvme/tree.c -@@ -1292,6 +1292,8 @@ static char *nvme_ctrl_lookup_phy_slot(nvme_root_t r, const char *address) - ret = asprintf(&path, "/sys/bus/pci/slots/%s", entry->d_name); - if (ret < 0) { - errno = ENOMEM; -+ free(target_addr); -+ closedir(slots_dir); - return NULL; - } - addr = nvme_get_attr(path, "address"); -@@ -1306,6 +1308,7 @@ static char *nvme_ctrl_lookup_phy_slot(nvme_root_t r, const char *address) - } - } - free(target_addr); -+ closedir(slots_dir); - if (found) - return strdup(entry->d_name); - return NULL; |