mirror of
https://github.com/vim/vim.git
synced 2026-05-28 00:21:37 +02:00
patch 9.2.0243: memory leak in change_indent()
Problem: memory leak in change_indent()
Solution: Free orig_line in the error case
(Huihui Huang)
closes: #19820
Signed-off-by: Huihui Huang <625173@qq.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
a4c0119786
commit
0effd2faf9
@@ -1513,7 +1513,10 @@ change_indent(
|
||||
// Save new line
|
||||
new_line = vim_strnsave(ml_get_curline(), ml_get_curline_len());
|
||||
if (new_line == NULL)
|
||||
{
|
||||
vim_free(orig_line);
|
||||
return;
|
||||
}
|
||||
|
||||
// We only put back the new line up to the cursor
|
||||
new_line[curwin->w_cursor.col] = NUL;
|
||||
|
||||
@@ -734,6 +734,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
243,
|
||||
/**/
|
||||
242,
|
||||
/**/
|
||||
|
||||
Reference in New Issue
Block a user