Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatheus Tavares <matheus.bernardino@usp.br>2020-09-29 03:01:53 +0300
committerJunio C Hamano <gitster@pobox.com>2020-09-29 03:41:53 +0300
commitbda959c4766d73ab435f26f2cc7c8c67b9443f5a (patch)
treed7ddc14cf2d77d2a9a467ce6e2c83dece7618fcb /git-cvsexportcommit.perl
parent74b052f8c269ef0b6f61a5ecf04a8568399345d9 (diff)
packfile: fix memory leak in add_delta_base_cache()
When add_delta_base_cache() is called with a base that is already in the cache, no operation is performed. But the check is done after allocating space for a new entry, so we end up leaking memory on the early return. In addition, the caller never free()'s the base as it expects the function to take ownership of it. But the base is not released when we skip insertion, so it also gets leaked. To fix these problems, move the allocation of a new entry further down in add_delta_base_cache(), and free() the base on early return. Signed-off-by: Matheus Tavares <matheus.bernardino@usp.br> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-cvsexportcommit.perl')
0 files changed, 0 insertions, 0 deletions