diff options
author | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2012-11-03 19:05:41 +0100 |
---|---|---|
committer | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2012-11-03 19:05:41 +0100 |
commit | 7af7a723ff3f001a075ca22d093a790752021051 (patch) | |
tree | 1cf3d214f6ad9e01c04c4ac4b2785231abff8f41 | |
parent | 8cd9ac98b1bb5a1df3d0084ae238f65261d357df (diff) |
fix nonCssProperties leak
Fix a leak related to inheritNonCssHints() that can be triggered
with following test case:
<table border=1>
<tr lang=en><td> table
</table>
noticed-by, test-case-by: corvid <corvid@lavabit.com>
-rw-r--r-- | src/styleengine.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/styleengine.cc b/src/styleengine.cc index f6043179..fe2d7b7d 100644 --- a/src/styleengine.cc +++ b/src/styleengine.cc @@ -167,8 +167,12 @@ void StyleEngine::inheritNonCssHints () { Node *pn = stack->getRef (stack->size () - 2); Node *n = stack->getRef (stack->size () - 1); - if (pn->nonCssProperties) - n->nonCssProperties = new CssPropertyList (*pn->nonCssProperties, true); + if (pn->nonCssProperties) { + if (n->nonCssProperties) + pn->nonCssProperties->apply (n->nonCssProperties); + else + n->nonCssProperties = new CssPropertyList(*pn->nonCssProperties, true); + } } void StyleEngine::clearNonCssHints () { |