Fix use after free when sending error messages. From Timo Juhani Lindfors
--HG-- branch : 1.7
This commit is contained in:
@@ -390,7 +390,8 @@ log_error(flags, fmt, va_alist)
|
|||||||
else
|
else
|
||||||
warningx("%s", message);
|
warningx("%s", message);
|
||||||
}
|
}
|
||||||
efree(message);
|
if (logline != message)
|
||||||
|
efree(message);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Send a copy of the error via mail.
|
* Send a copy of the error via mail.
|
||||||
@@ -406,8 +407,7 @@ log_error(flags, fmt, va_alist)
|
|||||||
if (def_logfile)
|
if (def_logfile)
|
||||||
do_logfile(logline);
|
do_logfile(logline);
|
||||||
|
|
||||||
if (logline != message)
|
efree(logline);
|
||||||
efree(logline);
|
|
||||||
|
|
||||||
if (!ISSET(flags, NO_EXIT)) {
|
if (!ISSET(flags, NO_EXIT)) {
|
||||||
cleanup(0);
|
cleanup(0);
|
||||||
|
Reference in New Issue
Block a user