From 636af2198e7d9128d6bf49cd7f7119de62fd5975 Mon Sep 17 00:00:00 2001 From: Jacques Germishuys Date: Sun, 25 Jan 2015 14:38:10 +0200 Subject: [PATCH] Return early if allocating a git_pathspec_match_list failed --- src/pathspec.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pathspec.c b/src/pathspec.c index 8b469f717..97b5d94dc 100644 --- a/src/pathspec.c +++ b/src/pathspec.c @@ -315,6 +315,9 @@ static git_pathspec_match_list *pathspec_match_alloc( m = NULL; } + if (!m) + return NULL; + /* need to keep reference to pathspec and increment refcount because * failures array stores pointers to the pattern strings of the * pathspec that had no matches