1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-28 07:03:00 +08:00

fix(menu): use LV_ASSERT_MALLOC check for new_node (#3263)

Co-authored-by: pengyiqiang <pengyiqiang@xiaomi.com>
This commit is contained in:
_VIFEXTech 2022-04-12 02:31:30 +08:00 committed by GitHub
parent 9137840582
commit 96c4a45576
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -204,6 +204,7 @@ void lv_menu_set_page(lv_obj_t * obj, lv_obj_t * page)
/* Add a new node */ /* Add a new node */
lv_ll_t * history_ll = &(menu->history_ll); lv_ll_t * history_ll = &(menu->history_ll);
lv_menu_history_t * new_node = _lv_ll_ins_head(history_ll); lv_menu_history_t * new_node = _lv_ll_ins_head(history_ll);
LV_ASSERT_MALLOC(new_node);
new_node->page = page; new_node->page = page;
menu->cur_depth++; menu->cur_depth++;