Skip to content

Commit 921ef63

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 bb90240 + 6453bc2 commit 921ef63

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
@@ -54,7 +54,7 @@ static void repo_set_commondir(struct repository *repo,
5454
{
5555
struct strbuf sb = STRBUF_INIT;
5656

57-
free(repo->commondir);
57+
FREE_AND_NULL(repo->commondir);
5858

5959
if (commondir) {
6060
repo->different_commondir = 1;

0 commit comments

Comments
 (0)