Patch 9.0.0413

4 views
Skip to first unread message

Bram Moolenaar

unread,
Sep 8, 2022, 5:58:27 AM9/8/22
to vim...@googlegroups.com

Patch 9.0.0413
Problem: ASAN reports a memory leak.
Solution: Free the string received from the server. (Ken Takata,
closes #11080)
Files: src/clientserver.c


*** ../vim-9.0.0412/src/clientserver.c 2022-03-22 20:38:51.000000000 +0000
--- src/clientserver.c 2022-09-08 10:53:49.638937733 +0100
***************
*** 423,431 ****
if (argtype == ARGTYPE_EDIT_WAIT)
{
int numFiles = *argc - i - 1;
- int j;
char_u *done = alloc(numFiles);
- char_u *p;
# ifdef FEAT_GUI_MSWIN
NOTIFYICONDATA ni;
int count = 0;
--- 423,429 ----
***************
*** 450,455 ****
--- 448,455 ----
vim_memset(done, 0, numFiles);
while (memchr(done, 0, numFiles) != NULL)
{
+ char_u *p;
+ int j;
# ifdef MSWIN
p = serverGetReply(srv, NULL, TRUE, TRUE, 0);
if (p == NULL)
***************
*** 459,464 ****
--- 459,465 ----
break;
# endif
j = atoi((char *)p);
+ vim_free(p);
if (j >= 0 && j < numFiles)
{
# ifdef FEAT_GUI_MSWIN
*** ../vim-9.0.0412/src/version.c 2022-09-07 21:46:48.733219019 +0100
--- src/version.c 2022-09-08 10:55:06.306105719 +0100
***************
*** 705,706 ****
--- 705,708 ----
{ /* Add new patch number below this line */
+ /**/
+ 413,
/**/

--
How To Keep A Healthy Level Of Insanity:
5. Put decaf in the coffee maker for 3 weeks. Once everyone has gotten
over their caffeine addictions, switch to espresso.

/// 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