diff --git a/repository.c b/repository.c index 5d166b692c8aa8..a2e1b89e14d979 100644 --- a/repository.c +++ b/repository.c @@ -46,7 +46,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;