summaryrefslogtreecommitdiff
path: root/object.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-07-22 11:23:32 -0700
committerJunio C Hamano <gitster@pobox.com>2013-07-22 11:23:33 -0700
commit5701c3d701d3932d853ffb9f75ee8745fae21209 (patch)
tree2f9550d09b14533ba45671001d594bfd6116c21a /object.c
parent4ca8ae712c1bf73bf41247aed119a44acc01de03 (diff)
parent8e92e8f2422a5805916e5e14c6bebfd82467e044 (diff)
downloadgit-5701c3d701d3932d853ffb9f75ee8745fae21209.tar.gz
Merge branch 'sb/parse-object-buffer-eaten'
* sb/parse-object-buffer-eaten: parse_object_buffer: correct freeing the buffer
Diffstat (limited to 'object.c')
-rw-r--r--object.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/object.c b/object.c
index cbc7333a7e..d8a4b1ffbe 100644
--- a/object.c
+++ b/object.c
@@ -145,7 +145,7 @@ struct object *lookup_unknown_object(const unsigned char *sha1)
struct object *parse_object_buffer(const unsigned char *sha1, enum object_type type, unsigned long size, void *buffer, int *eaten_p)
{
struct object *obj;
- int eaten = 0;
+ *eaten_p = 0;
obj = NULL;
if (type == OBJ_BLOB) {
@@ -164,7 +164,7 @@ struct object *parse_object_buffer(const unsigned char *sha1, enum object_type t
if (!tree->object.parsed) {
if (parse_tree_buffer(tree, buffer, size))
return NULL;
- eaten = 1;
+ *eaten_p = 1;
}
}
} else if (type == OBJ_COMMIT) {
@@ -174,7 +174,7 @@ struct object *parse_object_buffer(const unsigned char *sha1, enum object_type t
return NULL;
if (!commit->buffer) {
commit->buffer = buffer;
- eaten = 1;
+ *eaten_p = 1;
}
obj = &commit->object;
}
@@ -191,7 +191,6 @@ struct object *parse_object_buffer(const unsigned char *sha1, enum object_type t
}
if (obj && obj->type == OBJ_NONE)
obj->type = type;
- *eaten_p = eaten;
return obj;
}