about summary refs log tree commit diff homepage
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-07-28 08:58:29 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-07-28 08:58:29 +0000
commit48e88fc93c95a84c53f7250fdc698f37d4623250 (patch)
tree2818cc0ab2c6354036491671714ecd8d1402d628
parent4c60e4c9e3b0f8a4933d11cac7acbead62e8f323 (diff)
downloadklee-48e88fc93c95a84c53f7250fdc698f37d4623250.tar.gz
Add missing va_end and null check.
git-svn-id: https://llvm.org/svn/llvm-project/klee/trunk@77312 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Core/Common.cpp4
1 files changed, 4 insertions, 0 deletions
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);