summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2014-04-23 12:53:42 -0400
committerTony Cook <tony@develop-help.com>2014-05-29 16:20:18 +1000
commit3ed3a8afebd64616aef147205403b96b30a4b4ee (patch)
tree17ccf956ff4b2802650f5c391dda020e0014e1a6 /util.c
parentdc21de0ce42c790f35d2d6062e09e01e787138af (diff)
downloadperl-3ed3a8afebd64616aef147205403b96b30a4b4ee.tar.gz
add va_end() calls where missing for a va_start() or va_end().
Fix for Coverity perl5 CIDs 29225, 29226, 29227, 29228, 29229: Missing varargs init or cleanup (VARARGS) missing va_end: va_end was not called for foo. Use of va_args must be finished off with va_end (in other words, use of va_start or va_copy must be bracketed off with va_end). In most platforms va_end is a no-op, but in some platforms it is required for proper cleanup (or face stack smash, or memory leak). Tony: move va_start() out of the declaration block
Diffstat (limited to 'util.c')
-rw-r--r--util.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/util.c b/util.c
index b90abe5adf..4daf01d95b 100644
--- a/util.c
+++ b/util.c
@@ -4935,6 +4935,7 @@ Perl_my_vsnprintf(char *buffer, const Size_t len, const char *format, va_list ap
retval = vsprintf(buffer, format, ap);
# endif
#endif /* #ifdef NEED_VA_COPY */
+ va_end(apc);
/* vsprintf() shows failure with < 0 */
if (retval < 0
#ifdef HAS_VSNPRINTF