Fix use after free when sending error messages. From Timo Juhani Lindfors

--HG--
branch : 1.7
This commit is contained in:
Todd C. Miller
2010-02-06 12:43:26 -05:00
parent c0f149b533
commit d4d13c1ca1

View File

@@ -390,7 +390,8 @@ log_error(flags, fmt, va_alist)
else
warningx("%s", message);
}
efree(message);
if (logline != message)
efree(message);
/*
* Send a copy of the error via mail.
@@ -406,8 +407,7 @@ log_error(flags, fmt, va_alist)
if (def_logfile)
do_logfile(logline);
if (logline != message)
efree(logline);
efree(logline);
if (!ISSET(flags, NO_EXIT)) {
cleanup(0);