Commit 043a87a0 by Edward Thomson

refdb: unlock mutex on assertion failure

If we're safely asserting (and returning an error to the caller), we
should still unlock our mutex.
parent d9b041e6
...@@ -1361,7 +1361,11 @@ static int packed_write(refdb_fs_backend *backend) ...@@ -1361,7 +1361,11 @@ static int packed_write(refdb_fs_backend *backend)
for (i = 0; i < git_sortedcache_entrycount(refcache); ++i) { for (i = 0; i < git_sortedcache_entrycount(refcache); ++i) {
struct packref *ref = git_sortedcache_entry(refcache, i); struct packref *ref = git_sortedcache_entry(refcache, i);
GIT_ASSERT(ref);
GIT_ASSERT_WITH_CLEANUP(ref, {
error = -1;
goto fail;
});
if ((error = packed_find_peel(backend, ref)) < 0) if ((error = packed_find_peel(backend, ref)) < 0)
goto fail; goto fail;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment