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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---

And of course just as I sent out
<cover-v4-0.5-00000000000-20210909T122802Z-avarab@xxxxxxxxx> 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




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux