diff options
| author | Junio C Hamano <gitster@pobox.com> | 2025-05-19 16:02:46 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-05-19 16:02:46 -0700 |
| commit | 6660b429294faef500809c4b2b35a1c0c05caf17 (patch) | |
| tree | 09b61ccc7198cd09173cdf7a00f4991e22fc10fe | |
| parent | effbd42255aa2d93fbd5298538295b25f2b19057 (diff) | |
| parent | e5dd0a05ed392bc0c2dde84a1ee1d6eaeaac357f (diff) | |
| download | git-6660b429294faef500809c4b2b35a1c0c05caf17.tar.xz | |
Merge branch 'ly/am-split-stgit-leakfix'
Leakfix.
* ly/am-split-stgit-leakfix:
builtin/am: fix memory leak in `split_mail_stgit_series`
| -rw-r--r-- | builtin/am.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/builtin/am.c b/builtin/am.c index 4afb519830..e32a3b4c97 100644 --- a/builtin/am.c +++ b/builtin/am.c @@ -850,8 +850,10 @@ static int split_mail_stgit_series(struct am_state *state, const char **paths, series_dir = dirname(series_dir_buf); fp = fopen(*paths, "r"); - if (!fp) + if (!fp) { + free(series_dir_buf); return error_errno(_("could not open '%s' for reading"), *paths); + } while (!strbuf_getline_lf(&sb, fp)) { if (*sb.buf == '#') |
