Skip to content

Commit b031c4e

Browse files
committed
patch 8.0.0235: memory leak in diff mode
Problem: Memory leak detected when running tests for diff mode. Solution: Free p_extra_free.
1 parent 941c12d commit b031c4e

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

src/screen.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3651,6 +3651,7 @@ win_line(
36513651
{
36523652
/* Draw the 'foldcolumn'. Allocate a buffer, "extra" may
36533653
* already be in use. */
3654+
vim_free(p_extra_free);
36543655
p_extra_free = alloc(12 + 1);
36553656

36563657
if (p_extra_free != NULL)
@@ -4695,6 +4696,7 @@ win_line(
46954696
p = alloc((unsigned)(len + 1));
46964697
vim_memset(p, ' ', len);
46974698
p[len] = NUL;
4699+
vim_free(p_extra_free);
46984700
p_extra_free = p;
46994701
for (i = 0; i < tab_len; i++)
47004702
{
@@ -4857,6 +4859,7 @@ win_line(
48574859
vim_memset(p, ' ', n_extra);
48584860
STRNCPY(p, p_extra + 1, STRLEN(p_extra) - 1);
48594861
p[n_extra] = NUL;
4862+
vim_free(p_extra_free);
48604863
p_extra_free = p_extra = p;
48614864
}
48624865
else
@@ -5784,6 +5787,7 @@ win_line(
57845787
}
57855788
#endif
57865789

5790+
vim_free(p_extra_free);
57875791
return row;
57885792
}
57895793

src/version.c

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

765765
static int included_patches[] =
766766
{ /* Add new patch number below this line */
767+
/**/
768+
235,
767769
/**/
768770
234,
769771
/**/

0 commit comments

Comments
 (0)