diff --git a/tree-diff.c b/tree-diff.c
index 0ef06a9e36f55c0caec51064f552decd8a58be13..382092bce0be4ac82098ccc9c19d52df80f4eafd 100644 (file)
--- a/tree-diff.c
+++ b/tree-diff.c
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]);