Commit 636af2198e7d9128d6bf49cd7f7119de62fd5975

Jacques Germishuys 2015-01-25T14:38:10

Return early if allocating a git_pathspec_match_list failed

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/src/pathspec.c b/src/pathspec.c
index 8b469f7..97b5d94 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