diff options
author | Junio C Hamano <gitster@pobox.com> | 2016-10-26 13:14:45 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-10-26 13:14:45 -0700 |
commit | a03973893bdbc1a53c705daf70a73994ac46492f (patch) | |
tree | 3758c6cc01531475917705c32eb7bf93c4d04d9f /git.c | |
parent | bfe800c9d758b4dd760e8457bc79d35362b1effd (diff) | |
parent | 13092a916d7b8211fd828a6a7ee0d3cefff995e1 (diff) | |
download | git-a03973893bdbc1a53c705daf70a73994ac46492f.tar.gz |
Merge branch 'jc/cocci-xstrdup-or-null'
Code cleanup.
* jc/cocci-xstrdup-or-null:
cocci: refactor common patterns to use xstrdup_or_null()
Diffstat (limited to 'git.c')
-rw-r--r-- | git.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -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]); } } |