1 Star 0 Fork 12

chengquan/libidn

forked from src-openEuler/libidn 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0003-Fix-unlikely-memory-leak-in-idna_to_unicode_4z4z.patch 824 Bytes
一键复制 编辑 原始数据 按行查看 历史
hexiaowen 提交于 2019-09-30 22:56 +08:00 . Package init
From c0374862fc911c88febfab36aedfceaa9e5d7d50 Mon Sep 17 00:00:00 2001
From: Miroslav Lichvar <mlichvar@redhat.com>
Date: Tue, 10 Jul 2018 16:09:19 +0200
Subject: [PATCH 3/3] Fix unlikely memory leak in idna_to_unicode_4z4z
---
lib/idna.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/lib/idna.c b/lib/idna.c
index 91e34f5..fae707c 100644
--- a/lib/idna.c
+++ b/lib/idna.c
@@ -658,7 +658,10 @@ idna_to_unicode_4z4z (const uint32_t * input, uint32_t ** output, int flags)
buflen = (size_t) (end - start);
buf = malloc (sizeof (buf[0]) * (buflen + 1));
if (!buf)
- return IDNA_MALLOC_ERROR;
+ {
+ free (out);
+ return IDNA_MALLOC_ERROR;
+ }
/* don't check return code as per specification! */
idna_to_unicode_44i (start, (size_t) (end - start),
--
1.8.3.1
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/chengquanspace/libidn.git
git@gitee.com:chengquanspace/libidn.git
chengquanspace
libidn
libidn
master

搜索帮助