diff options
author | Michael Elkins <me@sigpipe.org> | 2010-08-12 09:22:07 -0700 |
---|---|---|
committer | Michael Elkins <me@sigpipe.org> | 2010-08-12 09:22:07 -0700 |
commit | 1340e5fcb9ba11235cd48908b10d0dac88e7404c (patch) | |
tree | 625042803e172b25c5983e8324b8cfc652c43f63 | |
parent | 9ffe42284399f9bb92adaf99b828b73fd6d3c920 (diff) |
call va_end() even when vasprintf returns <0
-rw-r--r-- | safe_asprintf.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/safe_asprintf.c b/safe_asprintf.c index e99e6bed..7aad3d4b 100644 --- a/safe_asprintf.c +++ b/safe_asprintf.c @@ -67,12 +67,12 @@ int safe_asprintf (char **strp, const char *fmt, ...) va_list ap; va_start (ap, fmt); n = vsnprintf (*strp, rlen, fmt, ap); + va_end (ap); if (n < 0) { FREE (strp); return n; } - va_end (ap); if (n < rlen) { |