summaryrefslogtreecommitdiff
path: root/src/pathspec.c
diff options
context:
space:
mode:
authorArthur Schreiber <schreiber.arthur@googlemail.com>2014-01-13 17:51:08 +0100
committerArthur Schreiber <schreiber.arthur@googlemail.com>2014-01-13 22:17:07 +0100
commit63170bcae91e5ddf6c0a2589d7212e0e62c8b269 (patch)
tree7f8f0dacfba959a45b2f44bc3f1211d3a6954ad2 /src/pathspec.c
parentbe29dd82e27d3536b9c63f5835b102b28934555e (diff)
downloadlibgit2-63170bcae91e5ddf6c0a2589d7212e0e62c8b269.tar.gz
Fix a memory leak in `git_pathspec__vinit`.
Diffstat (limited to 'src/pathspec.c')
-rw-r--r--src/pathspec.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/pathspec.c b/src/pathspec.c
index bad8dacdb..d6ce09c02 100644
--- a/src/pathspec.c
+++ b/src/pathspec.c
@@ -89,8 +89,10 @@ int git_pathspec__vinit(
if (ret == GIT_ENOTFOUND) {
git__free(match);
continue;
- } else if (ret < 0)
+ } else if (ret < 0) {
+ git__free(match);
return ret;
+ }
if (git_vector_insert(vspec, match) < 0)
return -1;