diff options
author | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2012-11-07 00:56:44 +0100 |
---|---|---|
committer | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2012-11-07 00:56:44 +0100 |
commit | 6f7abb000d2f81274dadefe8319faedf457283fd (patch) | |
tree | 19be4b70c85c2e076e7e1bea08679ebbfc88abf0 /src/css.cc | |
parent | 6e7b1d003a90051f0fe4d27422940a72b886eea1 (diff) |
fix memory corruption introduced in bd95974b1399
Diffstat (limited to 'src/css.cc')
-rw-r--r-- | src/css.cc | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -85,10 +85,18 @@ void CssPropertyList::set (CssPropertyName name, CssValueType type, * \brief Merge properties into argument property list. */ void CssPropertyList::apply (CssPropertyList *props) { - for (int i = 0; i < size (); i++) + for (int i = 0; i < size (); i++) { + CssPropertyValue value = getRef (i)->value; + + if (props->ownerOfStrings && + (getRef (i)->type == CSS_TYPE_STRING || + getRef (i)->type == CSS_TYPE_SYMBOL)) + value.strVal = strdup(value.strVal); + props->set ((CssPropertyName) getRef (i)->name, (CssValueType) getRef (i)->type, - getRef (i)->value); + value); + } } void CssPropertyList::print () { |