fix minor memory leak in buffers

This commit is contained in:
Kovid Goyal 2024-09-26 01:32:36 +05:30
parent 271665dbaf
commit 866c14249b
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C

View file

@ -744,6 +744,7 @@ static CTFontRef nerd_font(CGFloat sz) {
}
if (buffers.sz < num_glyphs) {
buffers.sz = MAX(128, num_glyphs * 2);
free(buffers.boxes); free(buffers.glyphs); free(buffers.positions);
buffers.boxes = calloc(sizeof(buffers.boxes[0]), buffers.sz);
buffers.glyphs = calloc(sizeof(buffers.glyphs[0]), buffers.sz);
buffers.positions = calloc(sizeof(buffers.positions[0]), buffers.sz);