mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-13 19:44:28 +00:00
svg_loader: memleak prevention
If image href set more than once, the memory was not freed.
This commit is contained in:
parent
a08d6e5079
commit
99da490ef7
1 changed files with 1 additions and 0 deletions
|
@ -1628,6 +1628,7 @@ static bool _attrParseImageNode(void* data, const char* key, const char* value)
|
|||
}
|
||||
|
||||
if (!strcmp(key, "href") || !strcmp(key, "xlink:href")) {
|
||||
if (image->href && value) free(image->href);
|
||||
image->href = _idFromHref(value);
|
||||
} else if (!strcmp(key, "id")) {
|
||||
if (node->id && value) free(node->id);
|
||||
|
|
Loading…
Add table
Reference in a new issue