summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--perlio.c2
-rw-r--r--util.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/perlio.c b/perlio.c
index 89b8ee60b0..c3767f0c15 100644
--- a/perlio.c
+++ b/perlio.c
@@ -4913,13 +4913,13 @@ PerlIO_vprintf(PerlIO *f, const char *fmt, va_list ap)
va_list apc;
Perl_va_copy(ap, apc);
sv = vnewSVpvf(fmt, &apc);
+ va_end(apc);
#else
sv = vnewSVpvf(fmt, &ap);
#endif
s = SvPV_const(sv, len);
wrote = PerlIO_write(f, s, len);
SvREFCNT_dec(sv);
- va_end(apc);
return wrote;
}
diff --git a/util.c b/util.c
index 4daf01d95b..39b24f01e0 100644
--- a/util.c
+++ b/util.c
@@ -4928,6 +4928,7 @@ Perl_my_vsnprintf(char *buffer, const Size_t len, const char *format, va_list ap
# else
retval = vsprintf(buffer, format, apc);
# endif
+ va_end(apc);
#else
# ifdef HAS_VSNPRINTF
retval = vsnprintf(buffer, len, format, ap);
@@ -4935,7 +4936,6 @@ 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