yutani: fix incorrect allocation of menu bar objects

This commit is contained in:
K. Lange 2023-02-15 20:29:42 +09:00
parent 70ee297177
commit 84817dbb02

View File

@ -904,7 +904,7 @@ KRK_Method(MenuBar,__init__) {
NO_REINIT(MenuBar); NO_REINIT(MenuBar);
size_t count = entries->values.count; size_t count = entries->values.count;
struct menu_bar * out = malloc(sizeof(struct menu_bar)); struct menu_bar * out = calloc(sizeof(struct menu_bar), 1);
out->entries = calloc(sizeof(struct menu_bar_entries), count + 1); out->entries = calloc(sizeof(struct menu_bar_entries), count + 1);
for (size_t i = 0; i < count; ++i) { for (size_t i = 0; i < count; ++i) {