Skip to content

Commit

Permalink
kitty: kill memory leak in self-referential animation #2012
Browse files Browse the repository at this point in the history
  • Loading branch information
dankamongmen committed Aug 2, 2021
1 parent 49729dc commit 46a63c5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/lib/kitty.c
Original file line number Diff line number Diff line change
Expand Up @@ -739,9 +739,11 @@ write_kitty_data(FILE* fp, int linesize, int leny, int lenx, int cols,
}
tam[tyx].auxvector = tmp;
}else if(level == KITTY_SELFREF){
tam[tyx].auxvector = malloc(sizeof(tam[tyx].state));
if(tam[tyx].auxvector == NULL){
goto err;
tam[tyx].auxvector = malloc(sizeof(tam[tyx].state));
if(tam[tyx].auxvector == NULL){
goto err;
}
}
memcpy(tam[tyx].auxvector, &tam[tyx].state, sizeof(tam[tyx].state));
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/termdesc.c
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ apply_term_heuristics(tinfo* ti, const char* termname, int fd,
if(add_smulx_escapes(ti, tablelen, tableused)){
return -1;
}
if(compare_versions(ti->termversion, "0.22.0") >= 0){
if(compare_versions(ti->termversion, "0.22.1") >= 0){
setup_kitty_bitmaps(ti, fd, KITTY_SELFREF);
}else if(compare_versions(ti->termversion, "0.20.0") >= 0){
setup_kitty_bitmaps(ti, fd, KITTY_ANIMATION);
Expand Down

0 comments on commit 46a63c5

Please # to comment.