/* Returns 1 if successful, or -EINVAL if m is NULL.  */
int menu_destroy(struct menu *m)
/* Returns 1 if successful, or -EINVAL if m is NULL.  */
int menu_destroy(struct menu *m)
{
	if (!m)
		return -EINVAL;
	menu_items_iter(m, menu_item_destroy, NULL);
	if (m->title)
		free(m->title);
	free(m);
	return 1;
}