builtin/describe: fix trivial memory leak when describing blob
We never free the `struct strvec args` variable in `describe_blob()`, which thus causes a memory leak. Fix this. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>maint
parent
5a1e1e5d40
commit
ed041007f0
|
@ -529,6 +529,7 @@ static void describe_blob(struct object_id oid, struct strbuf *dst)
|
||||||
traverse_commit_list(&revs, process_commit, process_object, &pcd);
|
traverse_commit_list(&revs, process_commit, process_object, &pcd);
|
||||||
reset_revision_walk();
|
reset_revision_walk();
|
||||||
release_revisions(&revs);
|
release_revisions(&revs);
|
||||||
|
strvec_clear(&args);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void describe(const char *arg, int last_one)
|
static void describe(const char *arg, int last_one)
|
||||||
|
|
|
@ -8,6 +8,7 @@ test_description='test git-specific bash prompt functions'
|
||||||
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
||||||
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
||||||
|
|
||||||
|
TEST_PASSES_SANITIZE_LEAK=true
|
||||||
. ./lib-bash.sh
|
. ./lib-bash.sh
|
||||||
|
|
||||||
. "$GIT_BUILD_DIR/contrib/completion/git-prompt.sh"
|
. "$GIT_BUILD_DIR/contrib/completion/git-prompt.sh"
|
||||||
|
|
Loading…
Reference in New Issue