summaryrefslogtreecommitdiff
path: root/src/pack-objects.c
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@microsoft.com>2015-02-11 09:39:38 -0500
committerEdward Thomson <ethomson@edwardthomson.com>2015-02-12 22:54:47 -0500
commit2884cc42de8b20a58cec8488d014a853d47c047e (patch)
tree19dbb80072107fe65c7dd1de5dd849cc6914b154 /src/pack-objects.c
parent4aa664ae3953d99c2ae4cd769f02818bc122eebc (diff)
downloadlibgit2-2884cc42de8b20a58cec8488d014a853d47c047e.tar.gz
overflow checking: don't make callers set oom
Have the ALLOC_OVERFLOW testing macros also simply set_oom in the case where a computation would overflow, so that callers don't need to.
Diffstat (limited to 'src/pack-objects.c')
-rw-r--r--src/pack-objects.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/pack-objects.c b/src/pack-objects.c
index cd0deb29a..288077078 100644
--- a/src/pack-objects.c
+++ b/src/pack-objects.c
@@ -504,10 +504,8 @@ static git_pobject **compute_write_order(git_packbuilder *pb)
unsigned int i, wo_end, last_untagged;
git_pobject **wo;
- if ((wo = git__mallocarray(pb->nr_objects, sizeof(*wo))) == NULL) {
- giterr_set_oom();
+ if ((wo = git__mallocarray(pb->nr_objects, sizeof(*wo))) == NULL)
return NULL;
- }
for (i = 0; i < pb->nr_objects; i++) {
git_pobject *po = pb->object_list + i;