From c6bb5516772f641d8c7cdc213f9c7712ea5a33c0 Mon Sep 17 00:00:00 2001 From: Patrick Latifi Date: Sun, 28 Nov 2004 15:12:18 +0000 Subject: make sure va_end() is always called in all possible paths ok jfb --- usr.bin/cvs/buf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'usr.bin/cvs/buf.c') 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 * 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); -- cgit v1.2.3