forked from len0rd/rockbox
lib/skin_parser check that malloc succeeded
Change-Id: I32db233a53b0f693f815cf96bcbe6711c366e5b3
This commit is contained in:
parent
03a6eb63f1
commit
848633f921
1 changed files with 5 additions and 0 deletions
|
|
@ -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;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue