diff --git a/repository.c b/repository.c index 3427085fd6d2e4..74c572052bdc90 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;