summaryrefslogtreecommitdiff
path: root/src/menu.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/menu.c')
-rw-r--r--src/menu.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/menu.c b/src/menu.c
index 7a3edcb6f4f..705100381d5 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -176,6 +176,8 @@ save_menu_items (void)
static void
grow_menu_items (void)
{
+ if ((INT_MAX - MENU_ITEMS_PANE_LENGTH) / 2 < menu_items_allocated)
+ memory_full ();
menu_items_allocated *= 2;
menu_items = larger_vector (menu_items, menu_items_allocated, Qnil);
}