* grub-core/kern/disk.c (grub_disk_read_small): Fix memory leak.

This commit is contained in:
Vladimir 'phcoder' Serbinenko 2011-10-25 18:01:57 +02:00
parent f4d9b64bba
commit 9f326fba96
2 changed files with 7 additions and 0 deletions

View file

@ -1,3 +1,7 @@
2011-10-25 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/kern/disk.c (grub_disk_read_small): Fix memory leak.
2011-10-25 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/fs/romfs.c (grub_romfs_open): Add missing return.

View file

@ -442,6 +442,7 @@ grub_disk_read_small (grub_disk_t disk, grub_disk_addr_t sector,
}
}
grub_free (tmp_buf);
grub_errno = GRUB_ERR_NONE;
{
@ -468,9 +469,11 @@ grub_disk_read_small (grub_disk_t disk, grub_disk_addr_t sector,
grub_error_push ();
grub_dprintf ("disk", "%s read failed\n", disk->name);
grub_error_pop ();
grub_free (tmp_buf);
return grub_errno;
}
grub_memcpy (buf, tmp_buf + offset, size);
grub_free (tmp_buf);
return GRUB_ERR_NONE;
}
}