xdiff/xhistogram: move index allocation into find_lcs
[gitweb.git] / git.c
diff --git a/git.c b/git.c
index 5e50a41285bd7129aa1e1373276a6f22206831a5..7acf290e2385ab35c10db4dd318af51106b12b7b 100644 (file)
--- a/git.c
+++ b/git.c
@@ -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]);
        }
 }