Revision 1eec614b loader.c

b/loader.c
266 266
    if (lseek(fd, offset, SEEK_SET) < 0)
267 267
        return NULL;
268 268
    ptr = qemu_malloc(size);
269
    if (!ptr)
270
        return NULL;
271 269
    if (read(fd, ptr, size) != size) {
272 270
        qemu_free(ptr);
273 271
        return NULL;
......
505 503

  
506 504
    *ep = hdr->ih_ep;
507 505
    data = qemu_malloc(hdr->ih_size);
508
    if (!data)
509
        goto out;
510 506

  
511 507
    if (read(fd, data, hdr->ih_size) != hdr->ih_size) {
512 508
        fprintf(stderr, "Error reading file\n");

Also available in: Unified diff