From 8538af1107a6e894d4941708b77e79fac587e35d Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 6 Feb 2007 05:26:25 +0000 Subject: r21174: many thanks to Paul Wayper for pointing out that C99 requires a matching va_end() for each va_copy(). This doesn't matter for most architectures, but there could be some obscure ones where it does matter. some of this should be ported to Samba3 (This used to be commit 21eb316473486cb6b73bb3ff9c5f3a44ecd57e4a) --- source4/lib/util/dprintf.c | 2 +- source4/lib/util/util_file.c | 2 +- source4/lib/util/xfile.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'source4/lib/util') diff --git a/source4/lib/util/dprintf.c b/source4/lib/util/dprintf.c index 62dc2a227a..79b90ec3e1 100644 --- a/source4/lib/util/dprintf.c +++ b/source4/lib/util/dprintf.c @@ -39,8 +39,8 @@ _PUBLIC_ int d_vfprintf(FILE *f, const char *format, va_list ap) _PRINTF_ATTRIBU /* do any message translations */ va_copy(ap2, ap); - ret = vasprintf(&p, format, ap2); + va_end(ap2); if (ret <= 0) return ret; diff --git a/source4/lib/util/util_file.c b/source4/lib/util/util_file.c index 887efb9836..3c44351c50 100644 --- a/source4/lib/util/util_file.c +++ b/source4/lib/util/util_file.c @@ -364,8 +364,8 @@ _PUBLIC_ int vfdprintf(int fd, const char *format, va_list ap) _PRINTF_ATTRIBUTE va_list ap2; va_copy(ap2, ap); - len = vasprintf(&p, format, ap2); + va_end(ap2); if (len <= 0) return len; ret = write(fd, p, len); SAFE_FREE(p); diff --git a/source4/lib/util/xfile.c b/source4/lib/util/xfile.c index 1cf77a3220..870cd4c136 100644 --- a/source4/lib/util/xfile.c +++ b/source4/lib/util/xfile.c @@ -203,8 +203,8 @@ size_t x_fwrite(const void *p, size_t size, size_t nmemb, XFILE *f) va_list ap2; va_copy(ap2, ap); - len = vasprintf(&p, format, ap2); + va_end(ap2); if (len <= 0) return len; ret = x_fwrite(p, 1, len, f); SAFE_FREE(p); -- cgit