Merge branch 'ly/am-split-stgit-leakfix'
Leakfix. * ly/am-split-stgit-leakfix: builtin/am: fix memory leak in `split_mail_stgit_series`
This commit is contained in:
@@ -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 == '#')
|
||||
|
||||
Reference in New Issue
Block a user