mirror of
https://github.com/dankamongmen/notcurses.git
synced 2024-11-04 06:00:30 +00:00
only use tpreserved when it's not NULL #2132
This commit is contained in:
parent
0fd2fe7ce1
commit
0ee5ba4ffe
@ -1258,9 +1258,11 @@ notcurses* notcurses_core_init(const notcurses_options* opts, FILE* outfp){
|
||||
|
||||
err:
|
||||
logpanic("Alas, you will not be going to space today.\n");
|
||||
// FIXME looks like we have some memory leaks on this error path?
|
||||
fbuf_free(&ret->rstate.f);
|
||||
(void)tcsetattr(ret->tcache.ttyfd, TCSAFLUSH, ret->tcache.tpreserved);
|
||||
if(ret->tcache.tpreserved){
|
||||
(void)tcsetattr(ret->tcache.ttyfd, TCSAFLUSH, ret->tcache.tpreserved);
|
||||
free(ret->tcache.tpreserved);
|
||||
}
|
||||
drop_signals(ret);
|
||||
del_curterm(cur_term);
|
||||
pthread_mutex_destroy(&ret->stats.lock);
|
||||
|
@ -921,7 +921,7 @@ int interrogate_terminfo(tinfo* ti, const char* termtype, FILE* out, unsigned ut
|
||||
return 0;
|
||||
|
||||
err:
|
||||
if(ti->ttyfd >= 0){
|
||||
if(ti->tpreserved){
|
||||
tcsetattr(ti->ttyfd, TCSANOW, ti->tpreserved);
|
||||
}
|
||||
free(ti->tpreserved);
|
||||
|
Loading…
Reference in New Issue
Block a user