summaryrefslogtreecommitdiff
path: root/src/diff_file.c
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2014-03-25 16:52:01 -0700
committerRussell Belfer <rb@github.com>2014-03-25 16:52:01 -0700
commit591e82952a2835c3d411ee5abec78be3b0816861 (patch)
tree9ace05f25fd42e679f7bfab705188555522bf177 /src/diff_file.c
parenta15c7802c86cf995fa658ef0624c46d352ce9a81 (diff)
downloadlibgit2-591e82952a2835c3d411ee5abec78be3b0816861.tar.gz
Fix submodule leaks and invalid references
This cleans up some places I missed that could hold onto submodule references and cleans up the way in which the repository cache is both reloaded and released so that existing submodule references aren't destroyed inappropriately.
Diffstat (limited to 'src/diff_file.c')
-rw-r--r--src/diff_file.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/diff_file.c b/src/diff_file.c
index 2f3f797c5..b9f92df3f 100644
--- a/src/diff_file.c
+++ b/src/diff_file.c
@@ -320,7 +320,8 @@ static int diff_file_content_load_workdir_file(
error = git_filter_list_apply_to_data(&out, fl, &raw);
- git_buf_free(&raw);
+ if (out.ptr != raw.ptr)
+ git_buf_free(&raw);
if (!error) {
fc->map.len = out.size;