Unverified Commit 1e7c8b1f by Edward Thomson Committed by GitHub

Merge pull request #6206 from libgit2/ethomson/odb_write_failures

odb: check for write failures
parents d9863fc1 c19a3c7a
......@@ -1501,10 +1501,10 @@ int git_odb_write(
if ((error = git_odb_open_wstream(&stream, db, len, type)) != 0)
return error;
stream->write(stream, data, len);
error = stream->finalize_write(stream, oid);
git_odb_stream_free(stream);
if ((error = stream->write(stream, data, len)) == 0)
error = stream->finalize_write(stream, oid);
git_odb_stream_free(stream);
return error;
}
......
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