Free attributes before return NULL (#899)

This commit is contained in:
lutianxiong 2020-11-22 00:10:12 +08:00 committed by GitHub
parent 2d3ed43f4e
commit 8f0e7aa22a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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