No OOM for list_alloc()

This commit is contained in:
Felipe Oliveira Carvalho
2014-06-05 22:51:41 -03:00
parent 3cb3c20b74
commit 238fa72884
3 changed files with 32 additions and 50 deletions

View File

@@ -2735,13 +2735,11 @@ void u_eval_tree(u_header_T *first_uhp, list_T *list)
dict_add_nr_str(dict, "save", uhp->uh_save_nr, NULL);
if (uhp->uh_alt_next.ptr != NULL) {
list_T *alt_list = list_alloc();
list_T *alt_list = list_alloc();
if (alt_list != NULL) {
/* Recursive call to add alternate undo tree. */
u_eval_tree(uhp->uh_alt_next.ptr, alt_list);
dict_add_list(dict, "alt", alt_list);
}
/* Recursive call to add alternate undo tree. */
u_eval_tree(uhp->uh_alt_next.ptr, alt_list);
dict_add_list(dict, "alt", alt_list);
}
list_append_dict(list, dict);