diff options
author | Patrick Latifi <pat@cvs.openbsd.org> | 2004-11-28 15:12:18 +0000 |
---|---|---|
committer | Patrick Latifi <pat@cvs.openbsd.org> | 2004-11-28 15:12:18 +0000 |
commit | c6bb5516772f641d8c7cdc213f9c7712ea5a33c0 (patch) | |
tree | 82fc68bd84af8a4d48f3a54040527e2ef47f1bc4 /usr.bin/cvs/buf.c | |
parent | b4083bdd9e35a8a9ff1611292ce4b3e9c2cce55e (diff) |
make sure va_end() is always called in all possible paths
ok jfb
Diffstat (limited to 'usr.bin/cvs/buf.c')
-rw-r--r-- | usr.bin/cvs/buf.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/cvs/buf.c b/usr.bin/cvs/buf.c index 33b503d2014..016ef2977b5 100644 --- a/usr.bin/cvs/buf.c +++ b/usr.bin/cvs/buf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: buf.c,v 1.3 2004/09/27 13:29:27 joris Exp $ */ +/* $OpenBSD: buf.c,v 1.4 2004/11/28 15:12:17 pat Exp $ */ /* * Copyright (c) 2003 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -341,13 +341,13 @@ cvs_buf_fappend(BUF *b, const char *fmt, ...) va_list vap; va_start(vap, fmt); - ret = vasprintf(&str, fmt, vap); + va_end(vap); + if (ret == -1) { cvs_log(LP_ERRNO, "failed to format data"); return (-1); } - va_end(vap); ret = cvs_buf_append(b, str, ret); free(str); |