Skip to content

Commit 34c1a97

Browse files
committed
fixup! diff: munmap() file contents before running external diff
1 parent cd8b22d commit 34c1a97

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

diff.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3094,9 +3094,9 @@ static void run_external_diff(const char *pgm,
30943094
argv_array_pushf(&env, "GIT_DIFF_PATH_COUNTER=%d", ++o->diff_path_counter);
30953095
argv_array_pushf(&env, "GIT_DIFF_PATH_TOTAL=%d", q->nr);
30963096

3097-
if (one->should_munmap)
3097+
if (one && one->should_munmap)
30983098
diff_free_filespec_data(one);
3099-
if (two->should_munmap)
3099+
if (two && two->should_munmap)
31003100
diff_free_filespec_data(two);
31013101
if (run_command_v_opt_cd_env(argv.argv, RUN_USING_SHELL, NULL, env.argv))
31023102
die(_("external diff died, stopping at %s"), name);

0 commit comments

Comments
 (0)