X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=config.c;h=b6d789a189713a0259e3f8eb0e29ef657cde66c7;hb=8311158c66e0d83df950ea837fb1cb332c51f798;hp=edf9914df6a1a789780c98d53b7b779908bb9141;hpb=1ad4b17b069a7b692ab801bda37c5ab35ef0208e;p=git.git diff --git a/config.c b/config.c index edf9914df..b6d789a18 100644 --- a/config.c +++ b/config.c @@ -865,12 +865,12 @@ int git_config_early(config_fn_t fn, void *data, const char *repo_config) home = getenv("HOME"); if (home) { - char *user_config = xstrdup(mkpath("%s/.gitconfig", home)); + char buf[PATH_MAX]; + char *user_config = mksnpath(buf, sizeof(buf), "%s/.gitconfig", home); if (!access(user_config, R_OK)) { ret += git_config_from_file(fn, user_config, data); found += 1; } - free(user_config); } if (repo_config && !access(repo_config, R_OK)) {