From 48e88fc93c95a84c53f7250fdc698f37d4623250 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Tue, 28 Jul 2009 08:58:29 +0000 Subject: Add missing va_end and null check. git-svn-id: https://llvm.org/svn/llvm-project/klee/trunk@77312 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Core/Common.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib') diff --git a/lib/Core/Common.cpp b/lib/Core/Common.cpp index 44cdc9f0..4bf432cc 100644 --- a/lib/Core/Common.cpp +++ b/lib/Core/Common.cpp @@ -24,6 +24,9 @@ FILE* klee::klee_message_file = NULL; static void klee_vfmessage(FILE *fp, const char *pfx, const char *msg, va_list ap) { + if (!fp) + return; + fprintf(fp, "KLEE: "); if (pfx) fprintf(fp, "%s: ", pfx); vfprintf(fp, msg, ap); @@ -45,6 +48,7 @@ static void klee_vmessage(const char *pfx, bool onlyToFile, const char *msg, va_list ap2; va_copy(ap2, ap); klee_vfmessage(stderr, pfx, msg, ap2); + va_end(ap2); } klee_vfmessage(pfx ? klee_message_file : klee_warning_file, pfx, msg, ap); -- cgit 1.4.1