svg_loader SvgLoader: Copy the missing composite url

When copying an attribute, url information of stype's composite is overwritten with memcpy.
This causes double free by deleting the wrong string in freeNodeStyle.
This commit is contained in:
JunsuChoi 2021-06-22 16:07:55 +09:00 committed by Mira Grudzinska
parent 234c1cefc8
commit f20ef0dc15

View file

@ -1587,6 +1587,9 @@ static void _copyAttr(SvgNode* to, const SvgNode* from)
//Copy style attribute;
memcpy(to->style, from->style, sizeof(SvgStyleProperty));
//Copy style composite attribute (clip-path, mask, ...)
if (from->style->comp.url) to->style->comp.url = new string(from->style->comp.url->c_str());
//Copy node attribute
switch (from->type) {
case SvgNodeType::Circle: {