diff options
author | William Wilgus <wilgus.william@gmail.com> | 2021-08-03 22:09:34 -0400 |
---|---|---|
committer | William Wilgus <me.theuser@yahoo.com> | 2021-08-05 10:38:18 +0000 |
commit | 848633f921e85b6b298b1c949c17aea56b0af86a (patch) | |
tree | 9daf2acc3cf4070a6fe4ac91ef482d693a38cabd /lib/skin_parser/skin_parser.c | |
parent | 03a6eb63f1ad6c94aa693bf7d5c766b25072c5ef (diff) | |
download | rockbox-848633f921e85b6b298b1c949c17aea56b0af86a.tar.gz rockbox-848633f921e85b6b298b1c949c17aea56b0af86a.zip |
lib/skin_parser check that malloc succeeded
Change-Id: I32db233a53b0f693f815cf96bcbe6711c366e5b3
Diffstat (limited to 'lib/skin_parser/skin_parser.c')
-rw-r--r-- | lib/skin_parser/skin_parser.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/skin_parser/skin_parser.c b/lib/skin_parser/skin_parser.c index 1d784f918a..0610561699 100644 --- a/lib/skin_parser/skin_parser.c +++ b/lib/skin_parser/skin_parser.c | |||
@@ -778,6 +778,11 @@ static int skin_parse_tag(struct skin_element* element, const char** document) | |||
778 | else if (tolower(type_code) == 't') | 778 | else if (tolower(type_code) == 't') |
779 | { | 779 | { |
780 | struct skin_element* child = skin_alloc_element(); | 780 | struct skin_element* child = skin_alloc_element(); |
781 | if (!child) | ||
782 | { | ||
783 | skin_error(MEMORY_LIMIT_EXCEEDED, cursor); | ||
784 | return 0; | ||
785 | } | ||
781 | child->type = TAG; | 786 | child->type = TAG; |
782 | if (!skin_parse_tag(child, &cursor)) | 787 | if (!skin_parse_tag(child, &cursor)) |
783 | return 0; | 788 | return 0; |