mirror of
https://github.com/vim/vim.git
synced 2025-07-04 23:07:33 -04:00
patch 8.0.0235: memory leak in diff mode
Problem: Memory leak detected when running tests for diff mode. Solution: Free p_extra_free.
This commit is contained in:
parent
941c12da3c
commit
b031c4ea04
@ -3651,6 +3651,7 @@ win_line(
|
||||
{
|
||||
/* Draw the 'foldcolumn'. Allocate a buffer, "extra" may
|
||||
* already be in use. */
|
||||
vim_free(p_extra_free);
|
||||
p_extra_free = alloc(12 + 1);
|
||||
|
||||
if (p_extra_free != NULL)
|
||||
@ -4695,6 +4696,7 @@ win_line(
|
||||
p = alloc((unsigned)(len + 1));
|
||||
vim_memset(p, ' ', len);
|
||||
p[len] = NUL;
|
||||
vim_free(p_extra_free);
|
||||
p_extra_free = p;
|
||||
for (i = 0; i < tab_len; i++)
|
||||
{
|
||||
@ -4857,6 +4859,7 @@ win_line(
|
||||
vim_memset(p, ' ', n_extra);
|
||||
STRNCPY(p, p_extra + 1, STRLEN(p_extra) - 1);
|
||||
p[n_extra] = NUL;
|
||||
vim_free(p_extra_free);
|
||||
p_extra_free = p_extra = p;
|
||||
}
|
||||
else
|
||||
@ -5784,6 +5787,7 @@ win_line(
|
||||
}
|
||||
#endif
|
||||
|
||||
vim_free(p_extra_free);
|
||||
return row;
|
||||
}
|
||||
|
||||
|
@ -764,6 +764,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
235,
|
||||
/**/
|
||||
234,
|
||||
/**/
|
||||
|
Loading…
x
Reference in New Issue
Block a user