summaryrefslogtreecommitdiff
path: root/tree-diff.c
diff options
context:
space:
mode:
Diffstat (limited to 'tree-diff.c')
-rw-r--r--tree-diff.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/tree-diff.c b/tree-diff.c
index 0ef06a9e36..382092bce0 100644
--- a/tree-diff.c
+++ b/tree-diff.c
@@ -263,6 +263,10 @@ void diff_tree_setup_paths(const char **p)
paths = p;
nr_paths = count_paths(paths);
+ if (nr_paths == 0) {
+ pathlens = NULL;
+ return;
+ }
pathlens = xmalloc(nr_paths * sizeof(int));
for (i=0; i<nr_paths; i++)
pathlens[i] = strlen(paths[i]);