diff options
| author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2023-02-07 00:07:41 +0100 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2023-02-06 15:34:37 -0800 |
| commit | 486620ae0c4fd0c68cdd10140c769825d758564f (patch) | |
| tree | b6e29c36e0e58c75d259fa026efc0d0a8d2d1ec7 /http-backend.c | |
| parent | various: add missing clear_pathspec(), fix leaks (diff) | |
| download | git-486620ae0c4fd0c68cdd10140c769825d758564f.tar.gz git-486620ae0c4fd0c68cdd10140c769825d758564f.zip | |
name-rev: don't xstrdup() an already dup'd string
When "add_to_tip_table()" is called with a non-zero
"shorten_unambiguous" we always return an xstrdup()'d string, which
we'd then xstrdup() again, leaking memory. See [1] and [2] for how
this leak came about.
We could xstrdup() only if "shorten_unambiguous" wasn't true, but
let's instead inline this code, so that information on whether we need
to xstrdup() is contained within add_to_tip_table().
1. 98c5c4ad015 (name-rev: allow to specify a subpath for --refs
option, 2013-06-18)
2. b23e0b9353e (name-rev: allow converting the exact object name at
the tip of a ref, 2013-07-07)
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'http-backend.c')
0 files changed, 0 insertions, 0 deletions
