Skip to content

Commit 3a0e80f

Browse files
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 729f1e5 + 3a27cd0 commit 3a0e80f

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
@@ -136,7 +136,7 @@ static void repo_set_commondir(struct repository *repo,
136136
{
137137
struct strbuf sb = STRBUF_INIT;
138138

139-
free(repo->commondir);
139+
FREE_AND_NULL(repo->commondir);
140140

141141
if (commondir) {
142142
repo->different_commondir = 1;

0 commit comments

Comments
 (0)