fix memleak in GetTokenFromStream

check asp & php if ParseAttribute return NULL
This commit is contained in:
lutianxiong 2020-06-20 09:19:17 +08:00 committed by GitHub
parent d1b906991a
commit 4377ab84a4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;