Skip to content

Commit

Permalink
Add missing va_end and null check.
Browse files Browse the repository at this point in the history
git-svn-id: http://llvm.org/svn/llvm-project/klee/trunk@77312 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
ddunbar committed Jul 28, 2009
1 parent 8389462 commit 14987e0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/Core/Common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit 14987e0

Please sign in to comment.