diff options
| author | Edward Thomson <ethomson@edwardthomson.com> | 2022-02-07 11:22:04 -0500 |
|---|---|---|
| committer | Edward Thomson <ethomson@edwardthomson.com> | 2022-02-07 11:22:04 -0500 |
| commit | c19a3c7a23a972e25e013cff300343323e65a55f (patch) | |
| tree | 9d1b0147e2f06857d66762147b37e44df751ee5a /src/odb.c | |
| parent | d9863fc19eed8135f2fbcc4ee22ea950dcd6fddf (diff) | |
| download | libgit2-c19a3c7a23a972e25e013cff300343323e65a55f.tar.gz | |
odb: check for write failures
Diffstat (limited to 'src/odb.c')
| -rw-r--r-- | src/odb.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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; } |
