Skip to content

Commit

Permalink
owl_function_debugmsg: Be sure to match va_start with va_end
Browse files Browse the repository at this point in the history
Found by Coverity Scan service.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
  • Loading branch information
andersk committed May 5, 2014
1 parent cba6b9c commit b61ad80
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions functions.c
Expand Up @@ -1226,7 +1226,6 @@ void G_GNUC_PRINTF(1, 2) owl_function_debugmsg(const char *fmt, ...)
FILE *file;
time_t now;
va_list ap;
va_start(ap, fmt);

if (!owl_global_is_debug_fast(&g))
return;
Expand All @@ -1241,11 +1240,13 @@ void G_GNUC_PRINTF(1, 2) owl_function_debugmsg(const char *fmt, ...)
fprintf(file, "[%d - %s - %lds]: ",
(int) getpid(), tmpbuff, now - owl_global_get_starttime(&g));
g_free(tmpbuff);

va_start(ap, fmt);
vfprintf(file, fmt, ap);
va_end(ap);

putc('\n', file);
fflush(file);

va_end(ap);
}

void owl_function_beep(void)
Expand Down

0 comments on commit b61ad80

Please sign in to comment.