diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2019-12-24 00:40:39 -0500 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2019-12-24 06:40:39 +0100 |
commit | 7dacab9afd21485dff1a578a58840b71f3455bca (patch) | |
tree | 0518de444fb78072ae663f18be614bd40c41b828 /src/nvim/regexp.c | |
parent | 2ef72437fc2e20ed7eee2520d818d3039b8e52bb (diff) | |
download | rneovim-7dacab9afd21485dff1a578a58840b71f3455bca.tar.gz rneovim-7dacab9afd21485dff1a578a58840b71f3455bca.tar.bz2 rneovim-7dacab9afd21485dff1a578a58840b71f3455bca.zip |
vim-patch:8.2.0033: make_extmatch() OOM #11602
Problem: Crash when make_extmatch() runs out of memory.
Solution: Check for NULL. (Dominique Pelle, closs vim/vim#5392)
https://github.com/vim/vim/commit/7c77b3496710f1be3232cfdc7f6812347fbd914a
Diffstat (limited to 'src/nvim/regexp.c')
-rw-r--r-- | src/nvim/regexp.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/nvim/regexp.c b/src/nvim/regexp.c index 9bc7ef07eb..90dc8ab90f 100644 --- a/src/nvim/regexp.c +++ b/src/nvim/regexp.c @@ -3575,6 +3575,7 @@ theend: * Create a new extmatch and mark it as referenced once. */ static reg_extmatch_T *make_extmatch(void) + FUNC_ATTR_NONNULL_RET { reg_extmatch_T *em = xcalloc(1, sizeof(reg_extmatch_T)); em->refcnt = 1; |