summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2016-11-08 18:45:10 -0500
committerNick Mathewson <nickm@torproject.org>2016-11-08 18:45:10 -0500
commit31f41fe09613398dc818ae30251724779f1f53c8 (patch)
tree9f35daf845db83f00ba2f7caab08888483b76e54 /src/common
parent053cf55cab4753cf0bcfb7e3bc7cf7038833a3a7 (diff)
parent286fa94064dcc6d1b260bec77de052274e3c4403 (diff)
downloadtor-31f41fe09613398dc818ae30251724779f1f53c8.tar.gz
tor-31f41fe09613398dc818ae30251724779f1f53c8.zip
Merge branch 'maint-0.2.9'
Diffstat (limited to 'src/common')
-rw-r--r--src/common/compat.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/common/compat.c b/src/common/compat.c
index 4f2f9778f2..8d6a491c42 100644
--- a/src/common/compat.c
+++ b/src/common/compat.c
@@ -532,7 +532,10 @@ tor_vasprintf(char **strp, const char *fmt, va_list args)
/* On Windows, _vsnprintf won't tell us the length of the string if it
* overflows, so we need to use _vcsprintf to tell how much to allocate */
int len, r;
- len = _vscprintf(fmt, args);
+ va_list tmp_args;
+ va_copy(tmp_args, args);
+ len = _vscprintf(fmt, tmp_args);
+ va_end(tmp_args);
if (len < 0) {
*strp = NULL;
return -1;