加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
Revert-node_device-fix-leak-of-DIR.patch 1.31 KB
一键复制 编辑 原始数据 按行查看 历史
Adttil 提交于 2024-11-28 00:34 . libvirt update to version 9.10.0-13
From 27cb1a66b291d3493c12a8ebc90c28f7b1fe67b0 Mon Sep 17 00:00:00 2001
From: Adttil <2429917001@qq.com>
Date: Sat, 23 Nov 2024 18:15:26 +0800
Subject: [PATCH 2/2] Revert "node_device: fix leak of DIR*"
This reverts commit 3cd86072fd6725178b669174eb99ab24a0bcee6c.
Updating the dir variable in the udevGetVDPACharDev function
to a smart pointer fixed a bug where dir was not freeing,
but a previous incorrect commit resulted in a double free
of the pointer, and the patch is now rolled back
---
src/node_device/node_device_udev.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c
index aa2781db34..6c5b788279 100644
--- a/src/node_device/node_device_udev.c
+++ b/src/node_device/node_device_udev.c
@@ -1198,7 +1198,6 @@ udevGetVDPACharDev(const char *sysfs_path,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("vDPA chardev path '%1$s' does not exist"),
chardev);
- virDirClose(dir);
return -1;
}
VIR_DEBUG("vDPA chardev is at '%s'", chardev);
@@ -1207,9 +1206,6 @@ udevGetVDPACharDev(const char *sysfs_path,
break;
}
}
-
- virDirClose(dir);
-
if (direrr < 0)
return -1;
--
2.43.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化