struct Keymap *Keymaps[MENU_MAX];
struct KeymapList *NewKeymaps[MENU_MAX];
+static void mutt_keymap_free(struct Keymap **km);
+
/**
* alloc_keys - Allocate space for a sequence of keys
* @param len Number of keys
}
len = tmp->eq;
next = tmp->next;
- FREE(&tmp->macro);
- FREE(&tmp->keys);
- FREE(&tmp->desc);
- FREE(&tmp);
+ mutt_keymap_free(&tmp);
tmp = next;
} while (tmp && len >= pos);
map->eq = len;
for (map = Keymaps[i]; map; map = next)
{
next = map->next;
-
- FREE(&map->macro);
- FREE(&map->desc);
- FREE(&map->keys);
- FREE(&map);
+ mutt_keymap_free(&map);
}
Keymaps[i] = NULL;
}
}
+
+
+/**
+ * mutt_keymap_free - Free a Keymap
+ * @param km Keymap to free
+ */
+static void mutt_keymap_free(struct Keymap **km)
+{
+ if (!km || !*km)
+ return;
+
+ FREE(&(*km)->macro);
+ FREE(&(*km)->desc);
+ FREE(&(*km)->keys);
+ FREE(km);
+}