summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2016-10-26 13:32:30 (GMT)
committer Michael Drake <tlsa@netsurf-browser.org>2016-10-26 13:32:30 (GMT)
commit0f0342a4416a5b3bb03fe80d428d73a431f03a76 (patch)
tree4557acd625ff900e31c9c3627edc29194f393110
parent059c01c90f5d3e64287853293097f56b8ca8ec1d (diff)
downloadlibsvgtiny-0f0342a4416a5b3bb03fe80d428d73a431f03a76.tar.gz
libsvgtiny-0f0342a4416a5b3bb03fe80d428d73a431f03a76.tar.bz2
Parse: Avoid strndup with unchecked return value.
-rw-r--r--src/svgtiny.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/svgtiny.c b/src/svgtiny.c
index ec15b35..76df69a 100644
--- a/src/svgtiny.c
+++ b/src/svgtiny.c
@@ -1483,9 +1483,9 @@ static void _svgtiny_parse_color(const char *s, svgtiny_colour *c,
void svgtiny_parse_color(dom_string *s, svgtiny_colour *c,
struct svgtiny_parse_state *state)
{
- char *ss = strndup(dom_string_data(s), dom_string_byte_length(s));
- _svgtiny_parse_color(ss, c, state);
- free(ss);
+ dom_string_ref(s);
+ _svgtiny_parse_color(dom_string_data(s), c, state);
+ dom_string_unref(s);
}
/**