Ai
1 Star 0 Fork 79

linwei9/binutils

forked from src-openEuler/binutils
关闭
 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
bfd_check_format-memory-leak.patch 725 Bytes
一键复制 编辑 原始数据 按行查看 历史
wangchen 提交于 2020-05-15 11:36 +08:00 . fix memory leak in bfd_check_format()
From 9d78076ef8ef07890ad89c1122bdf49932a979a5 Mon Sep 17 00:00:00 2001
From: Alan Modra <amodra@gmail.com>
Date: Fri, 20 Dec 2019 10:03:30 +1030
Subject: [PATCH] bfd_check_format memory leak
* format.c (bfd_check_format_matches): Free matching_vector when
not returning matching target strings.
---
bfd/format.c | 2 ++
1 files changed, 2 insertions(+)
diff --git a/bfd/format.c b/bfd/format.c
index 1d1363d..17b4855 100644
--- a/bfd/format.c
+++ b/bfd/format.c
@@ -513,6 +513,8 @@ bfd_check_format_matches (bfd *abfd, bfd_format format, char ***matching)
*(const char **) &matching_vector[match_count] = name;
}
}
+ else if (matching_vector)
+ free (matching_vector);
return FALSE;
}
--
1.8.3.1
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/linwei9/binutils.git
git@gitee.com:linwei9/binutils.git
linwei9
binutils
binutils
master

搜索帮助