From 63170bcae91e5ddf6c0a2589d7212e0e62c8b269 Mon Sep 17 00:00:00 2001 From: Arthur Schreiber Date: Mon, 13 Jan 2014 17:51:08 +0100 Subject: [PATCH] Fix a memory leak in `git_pathspec__vinit`. --- src/pathspec.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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;