mirror of
https://github.com/dankamongmen/notcurses.git
synced 2024-11-06 03:20:26 +00:00
eliminate double-free of tpreserved
This commit is contained in:
parent
e968b3972c
commit
e1a1ac3497
@ -1262,7 +1262,7 @@ notcurses* notcurses_core_init(const notcurses_options* opts, FILE* outfp){
|
||||
err:
|
||||
logpanic("Alas, you will not be going to space today.\n");
|
||||
fbuf_free(&ret->rstate.f);
|
||||
if(ret->tcache.tpreserved){
|
||||
if(ret->tcache.ttyfd >= 0 && ret->tcache.tpreserved){
|
||||
(void)tcsetattr(ret->tcache.ttyfd, TCSAFLUSH, ret->tcache.tpreserved);
|
||||
free(ret->tcache.tpreserved);
|
||||
}
|
||||
|
@ -921,8 +921,9 @@ int interrogate_terminfo(tinfo* ti, const char* termtype, FILE* out, unsigned ut
|
||||
err:
|
||||
if(ti->tpreserved){
|
||||
(void)tcsetattr(ti->ttyfd, TCSANOW, ti->tpreserved);
|
||||
free(ti->tpreserved);
|
||||
ti->tpreserved = NULL;
|
||||
}
|
||||
free(ti->tpreserved);
|
||||
free(ti->esctable);
|
||||
free(ti->termversion);
|
||||
del_curterm(cur_term);
|
||||
|
Loading…
Reference in New Issue
Block a user