summaryrefslogtreecommitdiff
path: root/src/odb_loose.c
diff options
context:
space:
mode:
authorJakob Pfender <jpfender@elegosoft.com>2011-05-19 12:27:43 +0200
committerVicent Marti <tanoku@gmail.com>2011-05-23 21:09:21 +0300
commitf93f8ec5d09930794847b3f560c2d79b5816aed3 (patch)
tree15423834fd7822d0d20d1da84692b037e1fed1a6 /src/odb_loose.c
parent1e85d1aa03d593386244fb914c8d1c208e94d8d8 (diff)
downloadlibgit2-f93f8ec5d09930794847b3f560c2d79b5816aed3.tar.gz
odb_loose.c: Return GIT_ENOMEM when allocation fails
When trying to inflate a buffer, a GIT_ERROR was returned when malloc() failed. Fix this to return GIT_ENOMEM.
Diffstat (limited to 'src/odb_loose.c')
-rw-r--r--src/odb_loose.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/odb_loose.c b/src/odb_loose.c
index 873dbfa0a..30f6d2ef4 100644
--- a/src/odb_loose.c
+++ b/src/odb_loose.c
@@ -315,7 +315,7 @@ static int inflate_packlike_loose_disk_obj(git_rawobj *out, gitfo_buf *obj)
*/
buf = git__malloc(hdr.size + 1);
if (!buf)
- return GIT_ERROR;
+ return GIT_ENOMEM;
in = ((unsigned char *)obj->data) + used;
len = obj->len - used;
@@ -363,7 +363,7 @@ static int inflate_disk_obj(git_rawobj *out, gitfo_buf *obj)
* (including the initial sequence in the head buffer).
*/
if ((buf = inflate_tail(&zs, head, used, &hdr)) == NULL)
- return GIT_ERROR;
+ return GIT_ENOMEM;
buf[hdr.size] = '\0';
out->data = buf;