Patch 8.2.2661

2 views
Skip to first unread message

Bram Moolenaar

unread,
Mar 26, 2021, 5:18:29 PM3/26/21
to vim...@googlegroups.com

Patch 8.2.2661
Problem: Leaking memory when looping over a string.
Solution: Free the memory.
Files: src/eval.c


*** ../vim-8.2.2660/src/eval.c 2021-03-26 20:41:24.773620612 +0100
--- src/eval.c 2021-03-26 22:10:48.509015043 +0100
***************
*** 1815,1822 ****
tv.v_lock = VAR_FIXED;
tv.vval.v_string = vim_strnsave(fi->fi_string + fi->fi_byte_idx, len);
fi->fi_byte_idx += len;
! return ex_let_vars(arg, &tv, TRUE, fi->fi_semicolon,
fi->fi_varcount, flag, NULL) == OK;
}

item = fi->fi_lw.lw_item;
--- 1815,1824 ----
tv.v_lock = VAR_FIXED;
tv.vval.v_string = vim_strnsave(fi->fi_string + fi->fi_byte_idx, len);
fi->fi_byte_idx += len;
! result = ex_let_vars(arg, &tv, TRUE, fi->fi_semicolon,
fi->fi_varcount, flag, NULL) == OK;
+ vim_free(tv.vval.v_string);
+ return result;
}

item = fi->fi_lw.lw_item;
*** ../vim-8.2.2660/src/version.c 2021-03-26 21:27:48.580922728 +0100
--- src/version.c 2021-03-26 22:15:10.120230429 +0100
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 2661,
/**/

--
I am also told that there is a logical proof out there somewhere
that demonstrates that there is no task which duct tape cannot handle.
-- Paul Brannan

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