Skip to content

Commit

Permalink
issue #3392: add missing va_end
Browse files Browse the repository at this point in the history
  • Loading branch information
shimpe authored and mossheim committed Jan 16, 2018
1 parent ab5b268 commit 34aaf41
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions SCDoc/main.cpp
Expand Up @@ -12,6 +12,7 @@ void error(const char *fmt, ...)
va_start(vargs, fmt);
vfprintf(stderr, fmt, vargs);
fflush(stderr);
va_end(vargs);
}

void post(const char *fmt, ...)
Expand All @@ -20,6 +21,7 @@ void post(const char *fmt, ...)
va_start(vargs, fmt);
vfprintf(stderr, fmt, vargs);
fflush(stderr);
va_end(vargs);
}

int main(int argc, char **argv)
Expand Down
1 change: 1 addition & 0 deletions lang/LangPrimSource/SC_HID_api.cpp
Expand Up @@ -54,6 +54,7 @@ static inline void trace(const char *fmt, ...)
va_list ap;
va_start(ap, fmt);
vpost(fmt, ap);
va_end(ap);
}
#else
static inline void trace(...)
Expand Down
3 changes: 3 additions & 0 deletions lang/LangSource/SC_LanguageClient.cpp
Expand Up @@ -393,6 +393,7 @@ void post(const char *fmt, ...)
va_list ap;
va_start(ap, fmt);
vpost(fmt, ap);
va_end(ap);
}

void postfl(const char *fmt, ...)
Expand All @@ -406,6 +407,7 @@ void postfl(const char *fmt, ...)
if (client) client->postFlush(buf, sc_min(n, sizeof(buf) - 1));
SC_LanguageClient::unlockInstance();
}
va_end(ap);
}

void postText(const char *str, long len)
Expand Down Expand Up @@ -433,6 +435,7 @@ void error(const char *fmt, ...)
if (client) client->postError(buf, sc_min(n, sizeof(buf) - 1));
SC_LanguageClient::unlockInstance();
}
va_end(ap);
}

void flushPostBuf(void)
Expand Down
2 changes: 1 addition & 1 deletion server/scsynth/SC_World.cpp
Expand Up @@ -1287,7 +1287,7 @@ int scprintf(const char *fmt, ...)
{
va_list vargs;
va_start(vargs, fmt);

va_end(vargs);
if (gPrint) return (*gPrint)(fmt, vargs);
else return vprintf(fmt, vargs);
}
1 change: 1 addition & 0 deletions server/supernova/sc/sc_synth.cpp
Expand Up @@ -277,6 +277,7 @@ struct scratchpad_printer
va_list vargs;
va_start(vargs, fmt);
printf(fmt, vargs);
va_end(vargs);
}

const char * data(void) const
Expand Down
1 change: 1 addition & 0 deletions server/supernova/server/server.cpp
Expand Up @@ -363,6 +363,7 @@ void realtime_engine_functor::log_printf_(const char * fmt, ...)
va_list vargs;
va_start(vargs, fmt);
instance->log_printf(fmt, vargs);
va_end(vargs);
}


Expand Down
1 change: 1 addition & 0 deletions server/supernova/server/server.hpp
Expand Up @@ -291,6 +291,7 @@ inline bool log_printf(const char *fmt, ...)
{
va_list vargs;
va_start(vargs, fmt);
va_end(vargs);
return instance->log_printf(fmt, vargs);
}

Expand Down

0 comments on commit 34aaf41

Please sign in to comment.