diff --git a/repository.c b/repository.c index c53e480e32..1fc188b2fc 100644 --- a/repository.c +++ b/repository.c @@ -51,7 +51,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;