hook: plug a new memory leak
In 8db1e8743c0 (clone: prevent hooks from running during a clone, 2024-03-28), I introduced an inadvertent memory leak that was unfortunately not caught before v2.45.1 was released. Here is a fix. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Schindelin committed
May 20, 2024 at 20:22 UTC
ee052533bb81aca6f94c0961222bed2a19789dae
1 file changed
+3
-1
hook.c
+3
-1
@@ -18,8 +18,10 @@ static int identical_to_template_hook(const char *name, const char *path)
18
found_template_hook = access(template_path.buf, X_OK) >= 0;
19
}
20
#endif
21
- if (!found_template_hook)
21
+ if (!found_template_hook) {
22
+ strbuf_release(&template_path);
23
return 0;
24
+ }
25
26
ret = do_files_match(template_path.buf, path);
27