Skip to content

Commit

Permalink
Fix global repository field not being cleared (#4083)
Browse files Browse the repository at this point in the history
It is checked for w.r.t. global repository struct down in the callstack
in compatibility layer for MinGW before being assigned in the function
that `free()`'d it.
  • Loading branch information
dscho authored and Git for Windows Build Agent committed Oct 22, 2024
2 parents 6b4308e + 5163481 commit 2e5a94e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion repository.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ static void repo_set_commondir(struct repository *repo,
{
struct strbuf sb = STRBUF_INIT;

free(repo->commondir);
FREE_AND_NULL(repo->commondir);

if (commondir) {
repo->different_commondir = 1;
Expand Down

0 comments on commit 2e5a94e

Please sign in to comment.