summaryrefslogtreecommitdiff
path: root/src/pathspec.c
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2013-12-06 15:04:31 -0800
committerRussell Belfer <rb@github.com>2013-12-11 10:57:49 -0800
commitfcd324c625d8be3f368c924d787e945e5812d8dd (patch)
treeac1e54b2538cdc10ee17dfd7c887c35dd1f572bf /src/pathspec.c
parentdab89f9b6821b67dd07c8bd4dbb53e25a3e687c7 (diff)
downloadlibgit2-fcd324c625d8be3f368c924d787e945e5812d8dd.tar.gz
Add git_vector_free_all
There are a lot of places that we call git__free on each item in a vector and then call git_vector_free on the vector itself. This just wraps that up into one convenient helper function.
Diffstat (limited to 'src/pathspec.c')
-rw-r--r--src/pathspec.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/src/pathspec.c b/src/pathspec.c
index 1e7e65e90..f16e19f47 100644
--- a/src/pathspec.c
+++ b/src/pathspec.c
@@ -102,15 +102,7 @@ int git_pathspec__vinit(
/* free data from the pathspec vector */
void git_pathspec__vfree(git_vector *vspec)
{
- git_attr_fnmatch *match;
- unsigned int i;
-
- git_vector_foreach(vspec, i, match) {
- git__free(match);
- vspec->contents[i] = NULL;
- }
-
- git_vector_free(vspec);
+ git_vector_free_all(vspec);
}
struct pathspec_match_context {