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:
@@ -79,6 +79,13 @@ VTerm *vterm_new_with_allocator(int rows, int cols, VTermAllocatorFunctions *fun
|
|||||||
|
|
||||||
vt->tmpbuffer_len = 64;
|
vt->tmpbuffer_len = 64;
|
||||||
vt->tmpbuffer = vterm_allocator_malloc(vt, vt->tmpbuffer_len);
|
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;
|
return vt;
|
||||||
}
|
}
|
||||||
@@ -93,6 +100,7 @@ void vterm_free(VTerm *vt)
|
|||||||
|
|
||||||
vterm_allocator_free(vt, vt->parser.strbuffer);
|
vterm_allocator_free(vt, vt->parser.strbuffer);
|
||||||
vterm_allocator_free(vt, vt->outbuffer);
|
vterm_allocator_free(vt, vt->outbuffer);
|
||||||
|
vterm_allocator_free(vt, vt->tmpbuffer);
|
||||||
|
|
||||||
vterm_allocator_free(vt, vt);
|
vterm_allocator_free(vt, vt);
|
||||||
}
|
}
|
||||||
|
@@ -746,6 +746,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
788,
|
||||||
/**/
|
/**/
|
||||||
787,
|
787,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user