diff --git a/builtin/patch-id.c b/builtin/patch-id.c index 2781598ede..57d9bd4a65 100644 --- a/builtin/patch-id.c +++ b/builtin/patch-id.c @@ -173,6 +173,7 @@ static size_t get_one_patchid(struct object_id *next_oid, struct object_id *resu oidclr(next_oid, the_repository->hash_algo); flush_one_hunk(result, &ctx); + git_hash_discard(&ctx); return patchlen; } diff --git a/diff.c b/diff.c index 397e38b41c..f631bf1e2a 100644 --- a/diff.c +++ b/diff.c @@ -6958,6 +6958,7 @@ static int diff_get_patch_id(struct diff_options *options, struct object_id *oid flush_one_hunk(oid, &ctx); } + git_hash_discard(&ctx); return 0; }