neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

commit 45d09b46cebe928693f708b777e8b11ad6ec2602
parent 674d3b2d5f5f7ade20cbd88ed64d63a80bb7b302
Author: zeertzjq <zeertzjq@outlook.com>
Date:   Thu, 25 Aug 2022 09:07:04 +0800

vim-patch:8.2.3942: Coverity reports a possible memory leak

Problem:    Coverity reports a possible memory leak.
Solution:   Free the array if allocation fails.
https://github.com/vim/vim/commit/8e7cc6b920ddea37deaa5e6b7b3bdfff2222d137

Diffstat:
Msrc/nvim/insexpand.c | 2++
1 file changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/nvim/insexpand.c b/src/nvim/insexpand.c @@ -2820,6 +2820,8 @@ static void get_next_spell_completion(linenr_T lnum) int num_matches = expand_spelling(lnum, (char_u *)compl_pattern, &matches); if (num_matches > 0) { ins_compl_add_matches(num_matches, matches, p_ic); + } else { + xfree(matches); } }