tidy/free-attributes-before-return-NULL.patch
2020-11-26 11:50:22 +08:00

28 lines
725 B
Diff

From 8f0e7aa22a854add9e6082ca5136e82f032a236a Mon Sep 17 00:00:00 2001
From: lutianxiong <lutianxiong@huawei.com>
Date: Sun, 22 Nov 2020 00:10:12 +0800
Subject: [PATCH] Free attributes before return NULL (#899)
---
src/lexer.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/lexer.c b/src/lexer.c
index 49b74f5..16a8fef 100644
--- a/src/lexer.c
+++ b/src/lexer.c
@@ -3469,6 +3469,10 @@ static Node* GetTokenFromStream( TidyDocImpl* doc, GetTokenMode mode )
return node; /* the COMMENT token */
}
+ /* check attributes before return NULL */
+ if (attributes)
+ TY_(FreeAttribute)( doc, attributes );
+
DEBUG_LOG(SPRTF("Returning NULL...\n"));
return NULL;
}
--
1.8.3.1