diff options
author | Junio C Hamano <gitster@pobox.com> | 2018-03-22 14:24:10 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-03-22 14:24:10 -0700 |
commit | 7e44d8055c76d4e8291d6dae289ebccab1e72aab (patch) | |
tree | 0e75227f132a734d79dac0825ca134e69281d1fa /refs | |
parent | Merge branch 'jt/http-redact-cookies' into maint (diff) | |
parent | files_initial_transaction_commit(): only unlock if locked (diff) | |
download | tgif-7e44d8055c76d4e8291d6dae289ebccab1e72aab.tar.xz |
Merge branch 'mr/packed-ref-store-fix' into maint
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.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/refs/files-backend.c b/refs/files-backend.c index f75d960e19..bec8e30e9e 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; |