summaryrefslogtreecommitdiff
path: root/builtin/show-ref.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2021-09-07 22:10:22 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-09-07 22:18:59 (GMT)
commit92a5d1c9b446839a748a465518e5926451b63460 (patch)
tree11bf18dd2f07b19ae2fe861c1287924871e58303 /builtin/show-ref.c
parent225bc32a989d7a22fa6addafd4ce7dcd04675dbf (diff)
downloadgit-92a5d1c9b446839a748a465518e5926451b63460.zip
git-92a5d1c9b446839a748a465518e5926451b63460.tar.gz
git-92a5d1c9b446839a748a465518e5926451b63460.tar.bz2
hash-object: prefix_filename() returns allocated memory these days
Back when a1be47e4 (hash-object: fix buffer reuse with --path in a subdirectory, 2017-03-20) was written, the prefix_filename() helper used a static piece of memory to the caller, making the caller responsible for copying it, if it wants to keep it across another call to the same function. Two callers of the prefix_filename() in hash-object were made to xstrdup() the value obtained from it. But in the same series, when e4da43b1 (prefix_filename: return newly allocated string, 2017-03-20) changed the rule to gave the caller possession of the memory, we forgot to revert one of the xstrdup() changes, allowing the returned value to leak. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/show-ref.c')
0 files changed, 0 insertions, 0 deletions