summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Pospisil <mekishizufu@gmail.com>2014-04-25 15:49:26 +0200
committerJiri Pospisil <mekishizufu@gmail.com>2014-04-25 15:49:26 +0200
commit424222f4157b050fd6417b8805796f7183a38e03 (patch)
treec43e6940c780eec9167b5790de15ffc615ea8e04
parent8443ed6c1d1237e203474a772fb4281c382df6ac (diff)
downloadlibgit2-424222f4157b050fd6417b8805796f7183a38e03.tar.gz
Filter: Make sure to release local on error
-rw-r--r--src/filter.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/filter.c b/src/filter.c
index ff81eb14e..b2f57964a 100644
--- a/src/filter.c
+++ b/src/filter.c
@@ -617,7 +617,7 @@ int git_filter_list_apply_to_data(
si = di; /* swap buffers */
} else {
tgt->size = 0;
- return error;
+ goto cleanup;
}
}
@@ -625,9 +625,10 @@ int git_filter_list_apply_to_data(
if (si != 1)
git_buf_swap(dbuffer[0], dbuffer[1]);
+cleanup:
git_buf_free(&local); /* don't leak if we allocated locally */
- return 0;
+ return error;
}
int git_filter_list_apply_to_file(