diff --git a/repository.c b/repository.c index 9825a3089932ed..4d7f6d5f25c50b 100644 --- a/repository.c +++ b/repository.c @@ -96,7 +96,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;