]> git.ipfire.org Git - thirdparty/git.git/commit
refs/files: fix NULL pointer deref when releasing ref store
authorPatrick Steinhardt <ps@pks.im>
Thu, 6 Jun 2024 05:29:25 +0000 (07:29 +0200)
committerJunio C Hamano <gitster@pobox.com>
Thu, 6 Jun 2024 16:04:32 +0000 (09:04 -0700)
commitb3e098d6e77db87946c50c3517fbdeffe9168ca9
treec70c3a2c9564f68502c5e7a2308f50846f900279
parent120b67172f7858a70b36941fa31af58a0534020e
refs/files: fix NULL pointer deref when releasing ref store

The `free_ref_cache()` function is not `NULL` safe and will thus
segfault when being passed such a pointer. This can easily happen when
trying to release a partially initialized "files" ref store. Fix this.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
refs/ref-cache.c