From 591e82952a2835c3d411ee5abec78be3b0816861 Mon Sep 17 00:00:00 2001 From: Russell Belfer Date: Tue, 25 Mar 2014 16:52:01 -0700 Subject: 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. --- src/diff_file.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/diff_file.c') 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; -- cgit v1.2.1