X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=diffcore-pathspec.c;h=139fe882f9f85575af297a2131cfac2888ae3c73;hb=abb7c7b31c0896bd838bbb6437b310db5a42227a;hp=68fe009132d1e900138a9d61bb7c658e23d9b76d;hpb=5e80092f7e6db09a40a62e837ca3f74f0bc5ad73;p=git.git diff --git a/diffcore-pathspec.c b/diffcore-pathspec.c index 68fe0091..139fe882 100644 --- a/diffcore-pathspec.c +++ b/diffcore-pathspec.c @@ -48,6 +48,9 @@ void diffcore_pathspec(const char **pathspec) for (i = 0; pathspec[i]; i++) ; speccnt = i; + if (!speccnt) + return; + spec = xmalloc(sizeof(*spec) * speccnt); for (i = 0; pathspec[i]; i++) { spec[i].spec = pathspec[i];