# HG changeset patch # User Bram Moolenaar # Date 1640861103 -3600 # Node ID 3949037c47f9bc9ec5b9f65901dd4aba832c76e7 # Parent 4876191a71c036fbf8d2d3063616665d22aa57bc patch 8.2.3942: Coverity reports a possible memory leak Commit: https://github.com/vim/vim/commit/8e7cc6b920ddea37deaa5e6b7b3bdfff2222d137 Author: Bram Moolenaar Date: Thu Dec 30 10:32:25 2021 +0000 patch 8.2.3942: Coverity reports a possible memory leak Problem: Coverity reports a possible memory leak. Solution: Free the array if allocation fails. diff --git a/src/insexpand.c b/src/insexpand.c --- a/src/insexpand.c +++ b/src/insexpand.c @@ -3193,6 +3193,8 @@ get_next_spell_completion(linenr_T lnum num_matches = expand_spelling(lnum, compl_pattern, &matches); if (num_matches > 0) ins_compl_add_matches(num_matches, matches, p_ic); + else + vim_free(matches); #endif } diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -750,6 +750,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 3942, +/**/ 3941, /**/ 3940,