[Eve] Fix off-by-one memory allocation problem in more_menu_prefs_list_create().

SVN revision: 52351
This commit is contained in:
Leandro Pereira 2010-09-16 22:43:04 +00:00
parent 235788322a
commit 2e79b62368
1 changed files with 1 additions and 1 deletions

View File

@ -1330,7 +1330,7 @@ more_menu_prefs_list_create(More_Menu_Item *i, More_Menu_Preference *p)
if (!list) return NULL;
for (n_items = 0; list[n_items].title; n_items++);
if (!(mmi = calloc(n_items, sizeof(*mmi)))) return NULL;
if (!(mmi = calloc(n_items + 1, sizeof(*mmi)))) return NULL;
if ((pref_get = p->pref_get)) preference = pref_get(prefs);
for (item = 0; item < n_items; item++) {