1
0
Fork 0
forked from len0rd/rockbox

lib/skin_parser check that malloc succeeded

Change-Id: I32db233a53b0f693f815cf96bcbe6711c366e5b3
This commit is contained in:
William Wilgus 2021-08-03 22:09:34 -04:00 committed by William Wilgus
parent 03a6eb63f1
commit 848633f921

View file

@ -778,6 +778,11 @@ static int skin_parse_tag(struct skin_element* element, const char** document)
else if (tolower(type_code) == 't') else if (tolower(type_code) == 't')
{ {
struct skin_element* child = skin_alloc_element(); struct skin_element* child = skin_alloc_element();
if (!child)
{
skin_error(MEMORY_LIMIT_EXCEEDED, cursor);
return 0;
}
child->type = TAG; child->type = TAG;
if (!skin_parse_tag(child, &cursor)) if (!skin_parse_tag(child, &cursor))
return 0; return 0;