加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-udev-fix-potential-memleak.patch 1.51 KB
一键复制 编辑 原始数据 按行查看 历史
From f4a8e2c2115fc901e588a1672f129e7e3371f5d7 Mon Sep 17 00:00:00 2001
From: Yu Watanabe <watanabe.yu+github@gmail.com>
Date: Fri, 27 Aug 2021 17:27:26 +0900
Subject: [PATCH] udev: fix potential memleak
(cherry picked from commit 4154524d47d24bcee3ebfed939912a847ebeb1b3)
Conflict:NA
Reference:https://github.com/systemd/systemd/commit/f4a8e2c2115fc901e588a1672f129e7e3371f5d7
---
src/udev/udev-builtin-net_id.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/udev/udev-builtin-net_id.c b/src/udev/udev-builtin-net_id.c
index 92917852ba..2699a8929f 100644
--- a/src/udev/udev-builtin-net_id.c
+++ b/src/udev/udev-builtin-net_id.c
@@ -103,7 +103,6 @@ static int get_virtfn_info(sd_device *dev, struct netnames *names, struct virtfn
_cleanup_(sd_device_unrefp) sd_device *physfn_pcidev = NULL;
const char *physfn_link_file, *syspath;
_cleanup_free_ char *physfn_pci_syspath = NULL;
- _cleanup_free_ char *virtfn_pci_syspath = NULL;
struct dirent *dent;
_cleanup_closedir_ DIR *dir = NULL;
char suffix[ALTIFNAMSIZ];
@@ -134,7 +133,7 @@ static int get_virtfn_info(sd_device *dev, struct netnames *names, struct virtfn
return -errno;
FOREACH_DIRENT_ALL(dent, dir, break) {
- _cleanup_free_ char *virtfn_link_file = NULL;
+ _cleanup_free_ char *virtfn_link_file = NULL, *virtfn_pci_syspath = NULL;
if (!startswith(dent->d_name, "virtfn"))
continue;
--
2.33.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化