Merge branch 'jc/cocci-xstrdup-or-null'

Code cleanup.

* jc/cocci-xstrdup-or-null:
  cocci: refactor common patterns to use xstrdup_or_null()
This commit is contained in:
Junio C Hamano
2016-10-26 13:14:45 -07:00
7 changed files with 17 additions and 20 deletions

3
git.c
View File

@ -35,8 +35,7 @@ static void save_env_before_alias(void)
orig_cwd = xgetcwd();
for (i = 0; i < ARRAY_SIZE(env_names); i++) {
orig_env[i] = getenv(env_names[i]);
if (orig_env[i])
orig_env[i] = xstrdup(orig_env[i]);
orig_env[i] = xstrdup_or_null(orig_env[i]);
}
}