From 5aae2522cc518da5200f6401f10038ccafd770b3 Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Mon, 16 May 2016 08:55:34 +0200 Subject: [PATCH] log: don't fallback to stderr for out-of-memory situation We don't know if "ap" is still valid. Just don't do anything. --- src/log.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/log.c b/src/log.c index 1de756c7..8c85d5a1 100644 --- a/src/log.c +++ b/src/log.c @@ -143,7 +143,12 @@ vlog(int pri, const char *token, const char *fmt, va_list ap) free(result); return; } - /* Otherwise, fallback to output on stderr. */ + /* Otherwise, abort. We don't know if "ap" is still OK. We could + * have made a copy, but this is too much overhead for a + * situation that shouldn't happen. */ + return; + } + } /* Log to standard error in all cases */ -- 2.39.5