diff options
| author | Carlos Martín Nieto <cmn@dwim.me> | 2015-06-27 21:26:27 +0200 |
|---|---|---|
| committer | Carlos Martín Nieto <cmn@dwim.me> | 2015-06-27 21:26:27 +0200 |
| commit | fa399750c680aa254784a40193d73d373df5e3ea (patch) | |
| tree | 323c8a96c3228c8be291d028b50c3483fda07395 /src | |
| parent | 92ec9ed328c4864e9c3fc27d0894b40060eb74e5 (diff) | |
| parent | 24fa21f38e15b0c929cafb0c072e47708f18d663 (diff) | |
| download | libgit2-fa399750c680aa254784a40193d73d373df5e3ea.tar.gz | |
Merge pull request #3265 from libgit2/leaks
Plug a bunch of leaks
Diffstat (limited to 'src')
| -rw-r--r-- | src/diff_patch.c | 10 | ||||
| -rw-r--r-- | src/diff_print.c | 3 | ||||
| -rw-r--r-- | src/iterator.c | 3 |
3 files changed, 15 insertions, 1 deletions
diff --git a/src/diff_patch.c b/src/diff_patch.c index ec4979a52..0628da6f2 100644 --- a/src/diff_patch.c +++ b/src/diff_patch.c @@ -325,9 +325,14 @@ static int diff_binary(git_diff_output *output, git_patch *patch) old_data, old_len, new_data, new_len)) < 0) return error; - return giterr_set_after_callback_function( + error = giterr_set_after_callback_function( output->binary_cb(patch->delta, &binary, output->payload), "git_patch"); + + git__free((char *) binary.old_file.data); + git__free((char *) binary.new_file.data); + + return error; } static int diff_patch_generate(git_patch *patch, git_diff_output *output) @@ -377,6 +382,9 @@ static void diff_patch_free(git_patch *patch) git__free((char *)patch->diff_opts.old_prefix); git__free((char *)patch->diff_opts.new_prefix); + git__free((char *)patch->binary.old_file.data); + git__free((char *)patch->binary.new_file.data); + if (patch->flags & GIT_DIFF_PATCH_ALLOCATED) git__free(patch); } diff --git a/src/diff_print.c b/src/diff_print.c index c58698368..546488c2f 100644 --- a/src/diff_print.c +++ b/src/diff_print.c @@ -578,6 +578,9 @@ int git_diff_print( giterr_set_after_callback_function(error, "git_diff_print"); } + git__free(pi.nfile); + git__free(pi.ofile); + git_buf_free(&buf); return error; diff --git a/src/iterator.c b/src/iterator.c index 45eba3955..949949388 100644 --- a/src/iterator.c +++ b/src/iterator.c @@ -1926,6 +1926,9 @@ int git_iterator_walk( } done: + git__free(iterator_item); + git__free(cur_items); + if (error == GIT_ITEROVER) error = 0; |
