Skip to content

Commit 0effd2f

Browse files
huanghuihui0904chrisbra
authored andcommitted
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>
1 parent a4c0119 commit 0effd2f

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

src/indent.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1513,7 +1513,10 @@ change_indent(
15131513
// Save new line
15141514
new_line = vim_strnsave(ml_get_curline(), ml_get_curline_len());
15151515
if (new_line == NULL)
1516+
{
1517+
vim_free(orig_line);
15161518
return;
1519+
}
15171520

15181521
// We only put back the new line up to the cursor
15191522
new_line[curwin->w_cursor.col] = NUL;

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,8 @@ static char *(features[]) =
734734

735735
static int included_patches[] =
736736
{ /* Add new patch number below this line */
737+
/**/
738+
243,
737739
/**/
738740
242,
739741
/**/

0 commit comments

Comments
 (0)