[sprixels] plug two memory leaks

pull/1502/head
nick black 4 years ago
parent 94b073dd3d
commit 16b7910b57
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -1239,6 +1239,9 @@ plane_blit_sixel(sprixel* spx, char* s, int bytes, int rows, int cols,
}
if(n){
//fprintf(stderr, "TACACHE WAS: %p NOW: %p size: %d/%d\n", n->tacache, tacache, rows, cols);
if(n->tacache != tacache){
free(n->tacache);
}
n->tacache = tacache;
n->tacachey = rows;
n->tacachex = cols;

@ -100,6 +100,7 @@ sprixel* sprixel_alloc(ncplane* n, ncvisual* ncv, int dimy, int dimx){
int sprixel_load(sprixel* spx, char* s, int bytes, int placey, int placex,
int pixy, int pixx, int parse_start){
assert(spx->n);
free(spx->glyph);
spx->glyph = s;
spx->glyphlen = bytes;
spx->invalidated = SPRIXEL_INVALIDATED;

Loading…
Cancel
Save