diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-08-31 11:25:06 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-08-31 11:25:06 +0100 |
commit | 9ba6194d4cba60fec4ed10c33d2d4fbe6e38c696 (patch) | |
tree | 908ec5bf5c912a323b8d2412a1f4a68fd410bb03 /src/evalwindow.c | |
parent | b22653a98ed9252b88455c55e15c888c66c97927 (diff) |
patch 9.0.0338: return value of list_append_list() not always checkedv9.0.0338
Problem: Return value of list_append_list() not always checked.
Solution: Check return value and handle failure.
Diffstat (limited to 'src/evalwindow.c')
-rw-r--r-- | src/evalwindow.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/evalwindow.c b/src/evalwindow.c index 906c269789..7a019627fb 100644 --- a/src/evalwindow.c +++ b/src/evalwindow.c @@ -261,7 +261,7 @@ find_tabwin( } /* - * Get the layout of the given tab page for winlayout(). + * Get the layout of the given tab page for winlayout() and add it to "l". */ static void get_framelayout(frame_T *fr, list_T *l, int outer) @@ -281,7 +281,11 @@ get_framelayout(frame_T *fr, list_T *l, int outer) fr_list = list_alloc(); if (fr_list == NULL) return; - list_append_list(l, fr_list); + if (list_append_list(l, fr_list) == FAIL) + { + vim_free(fr_list); + return; + } } if (fr->fr_layout == FR_LEAF) @@ -300,7 +304,12 @@ get_framelayout(frame_T *fr, list_T *l, int outer) win_list = list_alloc(); if (win_list == NULL) return; - list_append_list(fr_list, win_list); + if (list_append_list(fr_list, win_list) == FAIL) + { + vim_free(win_list); + return; + } + child = fr->fr_child; while (child != NULL) { |