Merge branch 'kg/external-diff-save-env'
[gitweb.git] / diff.c
diff --git a/diff.c b/diff.c
index 1b5f27636061feb0ecf273f257c5e080c5ff7481..b96b7a4fc61fcdd63dee0a890eb3b40be5d0414b 100644 (file)
--- a/diff.c
+++ b/diff.c
@@ -493,7 +493,7 @@ static const char *external_diff(void)
 
        if (done_preparing)
                return external_diff_cmd;
-       external_diff_cmd = getenv("GIT_EXTERNAL_DIFF");
+       external_diff_cmd = xstrdup_or_null(getenv("GIT_EXTERNAL_DIFF"));
        if (!external_diff_cmd)
                external_diff_cmd = external_diff_cmd_cfg;
        done_preparing = 1;