Commit ef902864 by Edward Thomson

odb: error when we can't alloc an object

At the moment, we're swallowing the allocation failure.  We need to
return the error to the caller.
parent 0fd0bfe4
...@@ -1048,8 +1048,10 @@ static int odb_read_1(git_odb_object **out, git_odb *db, const git_oid *id, ...@@ -1048,8 +1048,10 @@ static int odb_read_1(git_odb_object **out, git_odb *db, const git_oid *id,
} }
giterr_clear(); giterr_clear();
if ((object = odb_object__alloc(id, &raw)) == NULL) if ((object = odb_object__alloc(id, &raw)) == NULL) {
error = -1;
goto out; goto out;
}
*out = git_cache_store_raw(odb_cache(db), object); *out = git_cache_store_raw(odb_cache(db), object);
...@@ -1175,8 +1177,10 @@ static int read_prefix_1(git_odb_object **out, git_odb *db, ...@@ -1175,8 +1177,10 @@ static int read_prefix_1(git_odb_object **out, git_odb *db,
} }
} }
if ((object = odb_object__alloc(&found_full_oid, &raw)) == NULL) if ((object = odb_object__alloc(&found_full_oid, &raw)) == NULL) {
error = -1;
goto out; goto out;
}
*out = git_cache_store_raw(odb_cache(db), object); *out = git_cache_store_raw(odb_cache(db), object);
......
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