diff options
author | Yegappan Lakshmanan <yegappan@yahoo.com> | 2022-04-03 11:22:38 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-04-03 11:22:38 +0100 |
commit | 72bb47e38f6805050ed6d969f17591bed71f83d4 (patch) | |
tree | 2a129b54c7d20524362720c8385128d5a7c7fc41 /src/window.c | |
parent | 58f331a05f5b7bdddf04e68b6e51a827fd0c43f0 (diff) | |
download | vim-git-72bb47e38f6805050ed6d969f17591bed71f83d4.tar.gz |
patch 8.2.4670: memory allocation failures for new tab page not testedv8.2.4670
Problem: Memory allocation failures for new tab page not tested.
Solution: Add tests with failing memory allocation. (Yegappan Lakshmanan,
closes #10067)
Diffstat (limited to 'src/window.c')
-rw-r--r-- | src/window.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/window.c b/src/window.c index 78ce4d235..30fa80292 100644 --- a/src/window.c +++ b/src/window.c @@ -3801,6 +3801,8 @@ win_init_popup_win(win_T *wp, buf_T *buf) win_alloc_firstwin(win_T *oldwin) { curwin = win_alloc(NULL, FALSE); + if (curwin == NULL) + return FAIL; if (oldwin == NULL) { // Very first window, need to create an empty buffer for it and @@ -3882,7 +3884,7 @@ alloc_tabpage(void) # ifdef FEAT_EVAL // init t: variables - tp->tp_vars = dict_alloc(); + tp->tp_vars = dict_alloc_id(aid_newtabpage_tvars); if (tp->tp_vars == NULL) { vim_free(tp); @@ -5020,7 +5022,7 @@ win_alloc(win_T *after UNUSED, int hidden UNUSED) #ifdef FEAT_EVAL // init w: variables - new_wp->w_vars = dict_alloc(); + new_wp->w_vars = dict_alloc_id(aid_newwin_wvars); if (new_wp->w_vars == NULL) { win_free_lsize(new_wp); |