From d4d13c1ca1746f74645c845043d6c2d70d394f72 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Sat, 6 Feb 2010 12:43:26 -0500 Subject: [PATCH] Fix use after free when sending error messages. From Timo Juhani Lindfors --HG-- branch : 1.7 --- logging.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/logging.c b/logging.c index c9756dd8e..9034e7f0d 100644 --- a/logging.c +++ b/logging.c @@ -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); -- 2.40.0