Patch 8.2.2953

4 views
Skip to first unread message

Bram Moolenaar

unread,
Jun 6, 2021, 11:34:46 AM6/6/21
to vim...@googlegroups.com

Patch 8.2.2953 (after 8.2.2951)
Problem: Vim9: leaking memory when using heredoc script.
Solution: Free the first line.
Files: src/vim9execute.c


*** ../vim-8.2.2952/src/vim9execute.c 2021-06-06 17:02:49.753789485 +0200
--- src/vim9execute.c 2021-06-06 17:32:14.461252857 +0200
***************
*** 1460,1476 ****
case ISN_EXEC_SPLIT:
{
source_cookie_T cookie;

SOURCING_LNUM = iptr->isn_lnum;
CLEAR_FIELD(cookie);
cookie.sourcing_lnum = iptr->isn_lnum - 1;
cookie.nextline = iptr->isn_arg.string;
! if (do_cmdline(get_split_sourceline(0, &cookie, 0, 0),
get_split_sourceline, &cookie,
DOCMD_VERBOSE|DOCMD_NOWAIT|DOCMD_KEYTYPED)
== FAIL
|| did_emsg)
goto on_error;
}
break;

--- 1460,1482 ----
case ISN_EXEC_SPLIT:
{
source_cookie_T cookie;
+ char_u *line;

SOURCING_LNUM = iptr->isn_lnum;
CLEAR_FIELD(cookie);
cookie.sourcing_lnum = iptr->isn_lnum - 1;
cookie.nextline = iptr->isn_arg.string;
! line = get_split_sourceline(0, &cookie, 0, 0);
! if (do_cmdline(line,
get_split_sourceline, &cookie,
DOCMD_VERBOSE|DOCMD_NOWAIT|DOCMD_KEYTYPED)
== FAIL
|| did_emsg)
+ {
+ vim_free(line);
goto on_error;
+ }
+ vim_free(line);
}
break;

*** ../vim-8.2.2952/src/version.c 2021-06-06 17:12:43.204322378 +0200
--- src/version.c 2021-06-06 17:33:59.248975098 +0200
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 2953,
/**/

--
God made machine language; all the rest is the work of man.

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