mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-06-30 19:12:48 -05:00
Explicitly closing logctx on various kinds of error exit means that
the log file gets fclosed properly and the critical last few messages might be recoverable from the log file more often... [originally from svn r6834]
This commit is contained in:
@ -29,6 +29,10 @@ void fatalbox(char *p, ...)
|
||||
vfprintf(stderr, p, ap);
|
||||
va_end(ap);
|
||||
fputc('\n', stderr);
|
||||
if (logctx) {
|
||||
log_free(logctx);
|
||||
logctx = NULL;
|
||||
}
|
||||
cleanup_exit(1);
|
||||
}
|
||||
void modalfatalbox(char *p, ...)
|
||||
@ -39,6 +43,10 @@ void modalfatalbox(char *p, ...)
|
||||
vfprintf(stderr, p, ap);
|
||||
va_end(ap);
|
||||
fputc('\n', stderr);
|
||||
if (logctx) {
|
||||
log_free(logctx);
|
||||
logctx = NULL;
|
||||
}
|
||||
cleanup_exit(1);
|
||||
}
|
||||
void connection_fatal(void *frontend, char *p, ...)
|
||||
@ -49,6 +57,10 @@ void connection_fatal(void *frontend, char *p, ...)
|
||||
vfprintf(stderr, p, ap);
|
||||
va_end(ap);
|
||||
fputc('\n', stderr);
|
||||
if (logctx) {
|
||||
log_free(logctx);
|
||||
logctx = NULL;
|
||||
}
|
||||
cleanup_exit(1);
|
||||
}
|
||||
void cmdline_error(char *p, ...)
|
||||
|
Reference in New Issue
Block a user