Skip to content

Commit 2435f22

Browse files
dschoGit for Windows Build Agent
authored and
Git for Windows Build Agent
committed
Fix global repository field not being cleared (#4083)
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.
2 parents 995a166 + 2df0758 commit 2435f22

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

repository.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ static void repo_set_commondir(struct repository *repo,
4848
{
4949
struct strbuf sb = STRBUF_INIT;
5050

51-
free(repo->commondir);
51+
FREE_AND_NULL(repo->commondir);
5252

5353
if (commondir) {
5454
repo->different_commondir = 1;

0 commit comments

Comments
 (0)