summaryrefslogtreecommitdiff
path: root/refs
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-02-13 21:39:11 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-02-13 21:39:11 (GMT)
commit2b72ea0a48e8e5711f9bba122cbaf2bbe10737bc (patch)
treeee94c849b9efabb762d53b0567f69bae58756fdf /refs
parent53274637257aebdb5e30848d24c524bf5bbf70dc (diff)
parent81fcb698e03543d35c93ec6726a830aa6b9c5167 (diff)
downloadgit-2b72ea0a48e8e5711f9bba122cbaf2bbe10737bc.zip
git-2b72ea0a48e8e5711f9bba122cbaf2bbe10737bc.tar.gz
git-2b72ea0a48e8e5711f9bba122cbaf2bbe10737bc.tar.bz2
Merge branch 'mr/packed-ref-store-fix'
Crash fix for a corner case where an error codepath tried to unlock what it did not acquire lock on. * mr/packed-ref-store-fix: files_initial_transaction_commit(): only unlock if locked
Diffstat (limited to 'refs')
-rw-r--r--refs/files-backend.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/refs/files-backend.c b/refs/files-backend.c
index f75d960..bec8e30 100644
--- a/refs/files-backend.c
+++ b/refs/files-backend.c
@@ -2931,13 +2931,12 @@ static int files_initial_transaction_commit(struct ref_store *ref_store,
if (initial_ref_transaction_commit(packed_transaction, err)) {
ret = TRANSACTION_GENERIC_ERROR;
- goto cleanup;
}
+ packed_refs_unlock(refs->packed_ref_store);
cleanup:
if (packed_transaction)
ref_transaction_free(packed_transaction);
- packed_refs_unlock(refs->packed_ref_store);
transaction->state = REF_TRANSACTION_CLOSED;
string_list_clear(&affected_refnames, 0);
return ret;