1 Star 0 Fork 15

杨壮壮/gnupg2

forked from src-openEuler/gnupg2 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
fix-a-memory-leak-in-g10.patch 936 Bytes
一键复制 编辑 原始数据 按行查看 历史
anakinzhang 提交于 2020-06-03 16:29 . fix a memory leak in g10
From a861f9343d6e6d18064e4e54aeb914c5a10b2095 Mon Sep 17 00:00:00 2001
From: NIIBE Yutaka <gniibe@fsij.org>
Date: Wed, 17 Apr 2019 09:58:07 +0900
Subject: [PATCH] g10: Fix a memory leak.
* g10/import.c (import): Care PNDING_PKT on error.
--
GnuPG-bug-id: 4461
Reported-by: Philippe Antoine
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
---
g10/import.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/g10/import.c b/g10/import.c
index 565086773..00bc47cc1 100644
--- a/g10/import.c
+++ b/g10/import.c
@@ -689,6 +689,13 @@ import (ctrl_t ctrl, IOBUF inp, const char* fname,struct import_stats_s *stats,
log_error (_("error reading '%s': %s\n"), fname, gpg_strerror (rc));
release_kbnode (secattic);
+
+ /* When read_block loop was stopped by error, we have PENDING_PKT left. */
+ if (pending_pkt)
+ {
+ free_packet (pending_pkt, NULL);
+ xfree (pending_pkt);
+ }
return rc;
}
--
2.11.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yang_zhuang_zhuang/gnupg2.git
git@gitee.com:yang_zhuang_zhuang/gnupg2.git
yang_zhuang_zhuang
gnupg2
gnupg2
master

搜索帮助