diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2014-04-23 12:53:42 -0400 |
---|---|---|
committer | Tony Cook <tony@develop-help.com> | 2014-05-29 16:20:18 +1000 |
commit | 3ed3a8afebd64616aef147205403b96b30a4b4ee (patch) | |
tree | 17ccf956ff4b2802650f5c391dda020e0014e1a6 /util.c | |
parent | dc21de0ce42c790f35d2d6062e09e01e787138af (diff) | |
download | perl-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.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -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 |