Thread (17 messages) flat view 17 messages, 6 authors, 2022-06-17
STALE1524d

[PATCH 11/11] bug_fl(): add missing `va_end()` call

From: Johannes Schindelin via GitGitGadget <hidden>
Date: 2022-06-15 23:36:21
Subsystem: the rest · Maintainer: Linus Torvalds

From: Johannes Schindelin <redacted>

According to the manual:

	Each invocation of va_copy() must be matched by a corresponding
	invocation of va_end() in the  same function.

Note: There is another instance of `va_copy()` in `usage.c` that is
missing a `va_end()` call, in `BUG_vfl()`. It does not matter there,
though, because that function either `exit()`s or `abort()`s, anyway.

Reported by Coverity.

Signed-off-by: Johannes Schindelin <redacted>
---
 usage.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/usage.c b/usage.c
index 79900d0287f..4849eb75785 100644
--- a/usage.c
+++ b/usage.c
@@ -343,6 +343,7 @@ void bug_fl(const char *file, int line, const char *fmt, ...)
 	BUG_vfl_common(file, line, fmt, ap);
 	va_end(ap);
 	trace2_cmd_error_va(fmt, cp);
+	va_end(cp);
 }
 
 #ifdef SUPPRESS_ANNOTATED_LEAKS
-- 
gitgitgadget
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help