X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=config.c;h=e8f0caf7cf674ff44b23e0182420988e9672cc69;hb=4b4a5dbb17e1136275665024689625ed5cc5a03d;hp=c0897cc8076cfa62cd7e5b41513ae33c28e53dde;hpb=2d7320d0b09d7a9aab4e5dbc5458f37bfb6ce9f5;p=git.git diff --git a/config.c b/config.c index c0897cc80..e8f0caf7c 100644 --- a/config.c +++ b/config.c @@ -350,11 +350,11 @@ int git_config(config_fn_t fn) home = getenv("HOME"); filename = getenv("GIT_CONFIG_LOCAL"); if (!filename) - filename = repo_config = strdup(git_path("config")); + filename = repo_config = xstrdup(git_path("config")); } if (home) { - char *user_config = strdup(mkpath("%s/.gitconfig", home)); + char *user_config = xstrdup(mkpath("%s/.gitconfig", home)); if (!access(user_config, R_OK)) ret = git_config_from_file(fn, user_config); free(user_config); @@ -545,8 +545,8 @@ int git_config_set_multivar(const char* key, const char* value, if (!config_filename) config_filename = git_path("config"); } - config_filename = strdup(config_filename); - lock_file = strdup(mkpath("%s.lock", config_filename)); + config_filename = xstrdup(config_filename); + lock_file = xstrdup(mkpath("%s.lock", config_filename)); /* * Since "key" actually contains the section name and the real