1
0
forked from aniani/vim

patch 8.2.0788: memory leak in libvterm

Problem:    Memory leak in libvterm.
Solution:   free tmpbuffer.
This commit is contained in:
Bram Moolenaar
2020-05-17 23:34:42 +02:00
parent a2e408f598
commit deb17451ed
2 changed files with 10 additions and 0 deletions

View File

@@ -79,6 +79,13 @@ VTerm *vterm_new_with_allocator(int rows, int cols, VTermAllocatorFunctions *fun
vt->tmpbuffer_len = 64;
vt->tmpbuffer = vterm_allocator_malloc(vt, vt->tmpbuffer_len);
if (vt->tmpbuffer == NULL)
{
vterm_allocator_free(vt, vt->parser.strbuffer);
vterm_allocator_free(vt, vt);
vterm_allocator_free(vt, vt->outbuffer);
return NULL;
}
return vt;
}
@@ -93,6 +100,7 @@ void vterm_free(VTerm *vt)
vterm_allocator_free(vt, vt->parser.strbuffer);
vterm_allocator_free(vt, vt->outbuffer);
vterm_allocator_free(vt, vt->tmpbuffer);
vterm_allocator_free(vt, vt);
}

View File

@@ -746,6 +746,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
788,
/**/
787,
/**/