Patch 8.2.3942

7 views
Skip to first unread message

Bram Moolenaar

unread,
Dec 30, 2021, 5:33:29 AM12/30/21
to vim...@googlegroups.com

Patch 8.2.3942
Problem: Coverity reports a possible memory leak.
Solution: Free the array if allocation fails.
Files: src/insexpand.c


*** ../vim-8.2.3941/src/insexpand.c 2021-12-29 17:38:42.301517624 +0000
--- src/insexpand.c 2021-12-30 10:28:30.564981775 +0000
***************
*** 3193,3198 ****
--- 3193,3200 ----
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
}

*** ../vim-8.2.3941/src/version.c 2021-12-29 19:41:42.446404689 +0000
--- src/version.c 2021-12-30 10:30:15.092671835 +0000
***************
*** 751,752 ****
--- 751,754 ----
{ /* Add new patch number below this line */
+ /**/
+ 3942,
/**/

--
hundred-and-one symptoms of being an internet addict:
148. You find it easier to dial-up the National Weather Service
Weather/your_town/now.html than to simply look out the window.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages