git-commit-vandalism/refs
Patrick Steinhardt edc30691e5 refs: fix segfault when aborting empty transaction
When cleaning up a transaction that has no updates queued, then the
transaction's backend data will not have been allocated. We correctly
handle this for the packed backend, where the cleanup function checks
whether the backend data has been allocated at all -- if not, then there
is nothing to clean up. For the files backend we do not check this and
as a result will hit a segfault due to dereferencing a `NULL` pointer
when cleaning up such a transaction.

Fix the issue by checking whether `backend_data` is set in the files
backend, too.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-03-30 10:34:11 -07:00
..
files-backend.c refs: fix segfault when aborting empty transaction 2020-03-30 10:34:11 -07:00
iterator.c refs.c: migrate internal ref iteration to pass thru repository argument 2018-08-21 10:22:50 -07:00
packed-backend.c pack-refs: always refresh after taking the lock file 2019-08-02 09:59:05 -07:00
packed-backend.h refs/packed-backend.h: add missing declaration (hdr-check) 2018-09-20 11:50:00 -07:00
ref-cache.c convert "oidcmp() != 0" to "!oideq()" 2018-08-29 11:32:49 -07:00
ref-cache.h refs/ref-cache.h: add missing declarations (hdr-check) 2018-09-20 11:50:00 -07:00
refs-internal.h Fix spelling errors in code comments 2019-11-10 16:00:54 +09:00