Fix memory leaks
This commit is contained in:
parent
bc551c0d18
commit
90b658f767
@ -163,11 +163,13 @@
|
||||
// Process the commit
|
||||
num_commits++;
|
||||
|
||||
// ?? This causes subsequent walks to return commits with index 0
|
||||
// This causes subsequent walks to return commits with index 0 - unsure why
|
||||
// Checked with Valgrind - commenting this out seems not to leak memory
|
||||
//release_commit_memory(the_repository->parsed_objects, commit);
|
||||
//commit->parents = NULL;
|
||||
}
|
||||
reset_revision_walk();
|
||||
release_revisions(&rev);
|
||||
return num_commits;
|
||||
}
|
||||
|
||||
|
@ -50,8 +50,9 @@
|
||||
{! release_commit_memory(the_repository->parsed_objects, commit); !}
|
||||
{! commit->parents = NULL; !}
|
||||
{% endwhile %}
|
||||
{! reset_revision_walk(); !}
|
||||
</div>
|
||||
{! reset_revision_walk(); !}
|
||||
{! release_revisions(&rev); !}
|
||||
</main>
|
||||
{! page_end(); !}
|
||||
{% endpage %}
|
||||
|
@ -66,6 +66,7 @@
|
||||
{! cgit_print_age(info->committer_date, info->committer_tz, TM_WEEK * 2); !} ago
|
||||
</span>
|
||||
</div>
|
||||
{! cgit_free_commitinfo(info); !}
|
||||
{# Files #}
|
||||
{!
|
||||
const struct object_id *tree_oid = get_commit_tree_oid(commit);
|
||||
|
@ -85,6 +85,7 @@
|
||||
} else {
|
||||
cgit_tree_print_text_buffer(basename, buf, size);
|
||||
}
|
||||
free(buf);
|
||||
!}
|
||||
</div>
|
||||
{% endif %}
|
||||
@ -110,6 +111,7 @@
|
||||
strbuf_addstr(&buffer, pathname);
|
||||
if (strcmp(walk_tree_ctx->match_path, buffer.buf)) {
|
||||
// Not the target path, so continue to walk the tree
|
||||
strbuf_release(&buffer);
|
||||
return READ_TREE_RECURSIVE;
|
||||
}
|
||||
|
||||
@ -141,6 +143,7 @@
|
||||
tree_content_directory_item(oid, base, pathname, mode, walk_tree_ctx->directory_child_idx);
|
||||
walk_tree_ctx->directory_child_idx++;
|
||||
}
|
||||
strbuf_release(&buffer);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user