const char *path = entry->path;
 
        if (!entry->stage)
-               return read_sha1_file(get_object_hash(entry->blob->object), &type, size);
+               return read_sha1_file(entry->blob->object.oid.hash, &type, size);
        base = NULL;
        if (entry->stage == 1) {
                base = entry->blob;
        enum object_type type;
        while (entry) {
                if (entry->stage == 2)
-                       return read_sha1_file(get_object_hash(entry->blob->object), &type, size);
+                       return read_sha1_file(entry->blob->object.oid.hash, &type, size);
                entry = entry->link;
        }
        return NULL;
 
 static char *traverse_path(const struct traverse_info *info, const struct name_entry *n)
 {
-       char *path = xmalloc(traverse_path_len(info, n) + 1);
+       char *path = xmallocz(traverse_path_len(info, n));
        return make_traverse_path(path, info, n);
 }