Skip to content

Commit 3e6bef6

Browse files
author
Andrey Zabavnikov
committed
Fix global repository field not being cleared
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. Signed-off-by: Andrey Zabavnikov <[email protected]>
1 parent b85c8f6 commit 3e6bef6

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
@@ -46,7 +46,7 @@ static void repo_set_commondir(struct repository *repo,
4646
{
4747
struct strbuf sb = STRBUF_INIT;
4848

49-
free(repo->commondir);
49+
FREE_AND_NULL(repo->commondir);
5050

5151
if (commondir) {
5252
repo->different_commondir = 1;

0 commit comments

Comments
 (0)