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
index c547892..07ac71d 100644
--- a/src/insexpand.c
+++ b/src/insexpand.c
@@ -3193,6 +3193,8 @@
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
index 2a5260a..70372a6 100644
--- a/src/version.c
+++ b/src/version.c
@@ -750,6 +750,8 @@
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 3942,
+/**/
3941,
/**/
3940,