diff options
| author | Johannes Schindelin <johannes.schindelin@gmx.de> | 2024-05-20 20:22:00 +0000 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-05-21 12:33:08 -0700 |
| commit | ee052533bb81aca6f94c0961222bed2a19789dae (patch) | |
| tree | 299ff53012e520aa349d109fc91423d14cdcbb90 | |
| parent | d17d18f85a2d41a307d48c54b9da942cca530c1e (diff) | |
| download | git-ee052533bb81aca6f94c0961222bed2a19789dae.tar.gz | |
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>
| -rw-r--r-- | hook.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -18,8 +18,10 @@ static int identical_to_template_hook(const char *name, const char *path) found_template_hook = access(template_path.buf, X_OK) >= 0; } #endif - if (!found_template_hook) + if (!found_template_hook) { + strbuf_release(&template_path); return 0; + } ret = do_files_match(template_path.buf, path); |
