fix memleak in GetTokenFromStream
check asp & php if ParseAttribute return NULL
This commit is contained in:
parent
d1b906991a
commit
4377ab84a4
16
src/lexer.c
16
src/lexer.c
|
@ -3263,6 +3263,22 @@ static Node* GetTokenFromStream( TidyDocImpl* doc, GetTokenMode mode )
|
||||||
|
|
||||||
if (!name)
|
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 */
|
/* fix for http://tidy.sf.net/bug/788031 */
|
||||||
lexer->lexsize -= 1;
|
lexer->lexsize -= 1;
|
||||||
lexer->txtend = lexer->txtstart;
|
lexer->txtend = lexer->txtstart;
|
||||||
|
|
Loading…
Reference in a new issue