interrogate_terminfo: avoid double-free on error path

pull/2139/head
nick black 3 years ago
parent 42d1722ec7
commit 2e1ccdce15
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -745,7 +745,6 @@ int interrogate_terminfo(tinfo* ti, const char* termtype, FILE* out, unsigned ut
// need to send the identification queries. the controls are sufficient.
bool minimal = (ti->qterm != TERMINAL_UNKNOWN);
if(send_initial_queries(ti->ttyfd, minimal)){
free(ti->tpreserved);
goto err;
}
}
@ -755,7 +754,6 @@ int interrogate_terminfo(tinfo* ti, const char* termtype, FILE* out, unsigned ut
int termerr;
if(setupterm(termtype, ti->ttyfd, &termerr)){
logpanic("Terminfo error %d for %s (see terminfo(3ncurses))\n", termerr, termtype);
free(ti->tpreserved);
goto err;
}
tname = termname(); // longname() is also available

Loading…
Cancel
Save