summaryrefslogtreecommitdiff
path: root/src/pathspec.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pathspec.c')
-rw-r--r--src/pathspec.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/pathspec.c b/src/pathspec.c
index 19ea9eb19..83f776c91 100644
--- a/src/pathspec.c
+++ b/src/pathspec.c
@@ -238,9 +238,9 @@ int git_pathspec__init(git_pathspec *ps, const git_strarray *paths)
memset(ps, 0, sizeof(*ps));
ps->prefix = git_pathspec_prefix(paths);
- git_pool_init(&ps->pool, 1);
- if ((error = git_pathspec__vinit(&ps->pathspec, paths, &ps->pool)) < 0)
+ if ((error = git_pool_init(&ps->pool, 1)) < 0 ||
+ (error = git_pathspec__vinit(&ps->pathspec, paths, &ps->pool)) < 0)
git_pathspec__clear(ps);
return error;
@@ -316,7 +316,8 @@ static git_pathspec_match_list *pathspec_match_alloc(
if (!m)
return NULL;
- git_pool_init(&m->pool, 1);
+ if (git_pool_init(&m->pool, 1) < 0)
+ return NULL;
/* need to keep reference to pathspec and increment refcount because
* failures array stores pointers to the pattern strings of the