1 Star 0 Fork 12

yu_boyun/tidy

forked from src-openEuler/tidy 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
fix-memleak-in-GetTokenFromStream.patch 1.43 KB
一键复制 编辑 原始数据 按行查看 历史
lunankun 提交于 2020-11-20 17:16 . tidy:fix memleak
From 4377ab84a4a2748d72be91d26210567cc933c760 Mon Sep 17 00:00:00 2001
From: lutianxiong <[email protected]>
Date: Sat, 20 Jun 2020 09:19:17 +0800
Subject: [PATCH 095/109] fix memleak in GetTokenFromStream
check asp & php if ParseAttribute return NULL
---
src/lexer.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/src/lexer.c b/src/lexer.c
index ca66aee..bbc1e15 100644
--- a/src/lexer.c
+++ b/src/lexer.c
@@ -3263,6 +3263,22 @@ static Node* GetTokenFromStream( TidyDocImpl* doc, GetTokenMode mode )
if (!name)
{
+ /* check if attributes are created by ASP markup */
+ if (asp)
+ {
+ av = TY_(NewAttribute)(doc);
+ av->asp = asp;
+ AddAttrToList( &attributes, av );
+ }
+
+ /* check if attributes are created by PHP markup */
+ if (php)
+ {
+ av = TY_(NewAttribute)(doc);
+ av->php = php;
+ AddAttrToList( &attributes, av );
+ }
+
/* fix for http://tidy.sf.net/bug/788031 */
lexer->lexsize -= 1;
lexer->txtend = lexer->txtstart;
--
1.8.3.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yu_boyun/tidy.git
[email protected]:yu_boyun/tidy.git
yu_boyun
tidy
tidy
master

搜索帮助