aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2024-05-30 02:39:32 -0400
committerJunio C Hamano <gitster@pobox.com>2024-05-30 08:55:29 -0700
commitb639884f9ac78325b9a6658f23c9c245b8ac8263 (patch)
tree9de2c58b8372178c796fb5e67d2761a2cad5966b
parenta3f0e2a06496c8547b27921445ab47f482452a69 (diff)
downloadgit-b639884f9ac78325b9a6658f23c9c245b8ac8263.tar.gz
t-strvec: use va_end() to match va_start()
Our check_strvec_loc() helper uses a variable argument list. When we va_start(), we must be sure to va_end() before leaving the function. This is required by the standard (though the effect of forgetting will vary between platforms). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--t/unit-tests/t-strvec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/t/unit-tests/t-strvec.c b/t/unit-tests/t-strvec.c
index f17fb10d9e..6c1465ee61 100644
--- a/t/unit-tests/t-strvec.c
+++ b/t/unit-tests/t-strvec.c
@@ -22,11 +22,13 @@ static void check_strvec_loc(const char *loc, struct strvec *vec, ...)
strbuf_addf(&msg, "strvec index %"PRIuMAX, (uintmax_t) nr);
test_assert(loc, msg.buf, 0);
strbuf_release(&msg);
+ va_end(ap);
return;
}
nr++;
}
+ va_end(ap);
check_uint(vec->nr, ==, nr);
check_uint(vec->alloc, >=, nr);