Skip to content

Commit ee05253

Browse files
dschogitster
authored andcommitted
hook: plug a new memory leak
In 8db1e87 (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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent d17d18f commit ee05253

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

hook.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@ static int identical_to_template_hook(const char *name, const char *path)
1818
found_template_hook = access(template_path.buf, X_OK) >= 0;
1919
}
2020
#endif
21-
if (!found_template_hook)
21+
if (!found_template_hook) {
22+
strbuf_release(&template_path);
2223
return 0;
24+
}
2325

2426
ret = do_files_match(template_path.buf, path);
2527

0 commit comments

Comments
 (0)