From 08b4e062474b0f395797e9acccebefae2b81db03 Mon Sep 17 00:00:00 2001 From: Mukund Sivaraman Date: Sun, 24 Aug 2008 12:09:17 +0530 Subject: [PATCH] Fix leak of args --- src/log.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/log.c b/src/log.c index b53ee30..63bfc0e 100644 --- a/src/log.c +++ b/src/log.c @@ -137,15 +137,19 @@ log_message(int level, char *fmt, ...) if (!log_message_storage) { log_message_storage = vector_create(); - if (!log_message_storage) + if (!log_message_storage) { + va_end(args); return; + } } vsnprintf(str, STRING_LENGTH, fmt, args); entry_buffer = safemalloc(strlen(str) + 6); - if (!entry_buffer) + if (!entry_buffer) { + va_end(args); return; + } sprintf(entry_buffer, "%d %s", level, str); vector_append(log_message_storage, entry_buffer,