mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-02 17:42:31 +00:00
repository: clear out-parameter instead of freeing it
The `path` out-parameter of `find_repo` is being sanitized initially such that we do not try to append to existing content. The sanitization is done via `git_buf_free`, though, which forces us to needlessly reallocate the buffer later in the function. Fix this by using `git_buf_clear` instead.
This commit is contained in:
parent
e526fbc703
commit
57121a2377
@ -440,7 +440,7 @@ static int find_repo(
|
||||
bool in_dot_git;
|
||||
size_t ceiling_offset = 0;
|
||||
|
||||
git_buf_free(repo_path);
|
||||
git_buf_clear(repo_path);
|
||||
|
||||
error = git_path_prettify(&path, start_path, NULL);
|
||||
if (error < 0)
|
||||
|
Loading…
Reference in New Issue
Block a user