aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2012-11-07 00:56:44 +0100
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2012-11-07 00:56:44 +0100
commit6f7abb000d2f81274dadefe8319faedf457283fd (patch)
tree19be4b70c85c2e076e7e1bea08679ebbfc88abf0 /src
parent6e7b1d003a90051f0fe4d27422940a72b886eea1 (diff)
fix memory corruption introduced in bd95974b1399
Diffstat (limited to 'src')
-rw-r--r--src/css.cc12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/css.cc b/src/css.cc
index 48bd9c54..fd97e01e 100644
--- a/src/css.cc
+++ b/src/css.cc
@@ -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 () {