summaryrefslogtreecommitdiff
path: root/source3/lib/replace
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2007-02-06 05:58:35 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:17:45 -0500
commit5f8840ec844067dba987e8e28d8e96b90338d15c (patch)
treef6b37a0fa76a01c0c2d066d07b28d4efeb6a572c /source3/lib/replace
parent14785319cccde0e36c07927a6a3b23f52cbfb944 (diff)
downloadsamba-5f8840ec844067dba987e8e28d8e96b90338d15c.tar.gz
samba-5f8840ec844067dba987e8e28d8e96b90338d15c.tar.bz2
samba-5f8840ec844067dba987e8e28d8e96b90338d15c.zip
r21176: merged va_end() changes from Samba4
(This used to be commit 04f6f01dfeda2fa076209a94cdf8e59f6ce47008)
Diffstat (limited to 'source3/lib/replace')
-rw-r--r--source3/lib/replace/snprintf.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source3/lib/replace/snprintf.c b/source3/lib/replace/snprintf.c
index b38d8dad34..9f8a7657e5 100644
--- a/source3/lib/replace/snprintf.c
+++ b/source3/lib/replace/snprintf.c
@@ -742,6 +742,8 @@ static int dopr(char *buffer, size_t maxlen, const char *format, va_list args_in
ret = currlen;
done:
+ va_end(args);
+
while (chunks) {
cnk = chunks->next;
free(chunks);
@@ -1260,16 +1262,16 @@ static int add_cnk_list_entry(struct pr_chunk_x **list,
va_list ap2;
VA_COPY(ap2, ap);
-
ret = vsnprintf(NULL, 0, format, ap2);
+ va_end(ap2);
if (ret <= 0) return ret;
(*ptr) = (char *)malloc(ret+1);
if (!*ptr) return -1;
VA_COPY(ap2, ap);
-
ret = vsnprintf(*ptr, ret+1, format, ap2);
+ va_end(ap2);
return ret;
}