mirror of
https://github.com/git/git.git
synced 2026-01-10 01:56:42 +00:00
Merge branch 'ly/commit-buffer-reencode-leakfix'
Leakfix. * ly/commit-buffer-reencode-leakfix: repo_logmsg_reencode: fix memory leak when use repo_logmsg_reencode ()
This commit is contained in:
@@ -84,6 +84,7 @@ static struct commit *create_commit(struct repository *repo,
|
||||
obj = parse_object(repo, &ret);
|
||||
|
||||
out:
|
||||
repo_unuse_commit_buffer(the_repository, based_on, message);
|
||||
free_commit_extra_headers(extra);
|
||||
free_commit_list(parents);
|
||||
strbuf_release(&msg);
|
||||
|
||||
@@ -187,7 +187,7 @@ static void insert_records_from_trailers(struct shortlog *log,
|
||||
ctx->output_encoding);
|
||||
body = strstr(commit_buffer, "\n\n");
|
||||
if (!body)
|
||||
return;
|
||||
goto out;
|
||||
|
||||
trailer_iterator_init(&iter, body);
|
||||
while (trailer_iterator_advance(&iter)) {
|
||||
@@ -206,6 +206,7 @@ static void insert_records_from_trailers(struct shortlog *log,
|
||||
}
|
||||
trailer_iterator_release(&iter);
|
||||
|
||||
out:
|
||||
strbuf_release(&ident);
|
||||
repo_unuse_commit_buffer(the_repository, commit, commit_buffer);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user