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 -- [email protected] -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/202106061534.156FYeDC343667%40masaka.moolenaar.net.