`git_config_free` will be a no-op if cfg is NULL, so you don't need the `if` check.