Thread (581 messages) flat view 581 messages, 16 authors, 2021-10-12
STALE1802d

[PATCH v4] fixup! hook: run a list of hooks instead

From: Ævar Arnfjörð Bjarmason <hidden>
Date: 2021-09-09 14:24:49
Subsystem: the rest · Maintainer: Linus Torvalds

---

And of course just as I sent out
[ref] I noticed
that there was one last memory leak left, it just wasn't stressed by
t1800-hook.sh, but some of the test of the tests, including
t0000-basic.sh!

That test coverage should be improved, but in the meantime Junio:
Here's a fixup to the just-sent you can hopefully squash into the
1/5. Sorry about the screwup.

 hook.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/hook.c b/hook.c
index dc3033cb4c7..4b4205bce6c 100644
--- a/hook.c
+++ b/hook.c
@@ -416,8 +416,10 @@ int run_hooks_oneshot(const char *hook_name, struct run_hooks_opt *options)
 	 * If you need to act on a missing hook, use run_found_hooks()
 	 * instead
 	 */
-	if (list_empty(hooks))
+	if (list_empty(hooks)) {
+		clear_hook_list(hooks);
 		goto cleanup;
+	}
 
 	ret = run_hooks(hook_name, hooks, options);
 
-- 
2.33.0.867.g88ec4638586
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help