From d9dfbab71c8f508c9d90cd90228a18bb60ea43b9 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Sun, 21 May 2023 19:59:41 -0400 Subject: [PATCH] lib: va_end must be called According to the man page a va_start must be followed by a va_end before the end of the function. Signed-off-by: Donald Sharp --- lib/printf/glue.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/printf/glue.c b/lib/printf/glue.c index 25e2ff37a3..f799378af3 100644 --- a/lib/printf/glue.c +++ b/lib/printf/glue.c @@ -273,6 +273,7 @@ static ssize_t printfrr_va(struct fbuf *buf, struct printfrr_eargs *ea, { const struct va_format *vaf = ptr; va_list ap; + ssize_t s; if (!vaf || !vaf->fmt || !vaf->va) return bputs(buf, "NULL"); @@ -285,6 +286,9 @@ static ssize_t printfrr_va(struct fbuf *buf, struct printfrr_eargs *ea, #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wformat-nonliteral" /* can't format check this */ - return vbprintfrr(buf, vaf->fmt, ap); + s = vbprintfrr(buf, vaf->fmt, ap); #pragma GCC diagnostic pop + va_end(ap); + + return s; }