* grub-core/io/bufio.c (grub_bufio_open): Use grub_zalloc instead of
explicitly zeroing elements. * grub-core/io/gzio.c (grub_gzio_open): Likewise. * grub-core/io/lzopio.c (grub_lzopio_open): Remove explicit zeroing of elements in a structure already allocated using grub_zalloc. * grub-core/io/xzio.c (grub_xzio_open): Likewise.
This commit is contained in:
parent
86065b0ad6
commit
f8861eaf9f
5 changed files with 12 additions and 17 deletions
|
@ -48,7 +48,7 @@ grub_bufio_open (grub_file_t io, int size)
|
|||
grub_file_t file;
|
||||
grub_bufio_t bufio = 0;
|
||||
|
||||
file = (grub_file_t) grub_malloc (sizeof (*file));
|
||||
file = (grub_file_t) grub_zalloc (sizeof (*file));
|
||||
if (! file)
|
||||
return 0;
|
||||
|
||||
|
@ -61,7 +61,7 @@ grub_bufio_open (grub_file_t io, int size)
|
|||
size = ((io->size > GRUB_BUFIO_MAX_SIZE) ? GRUB_BUFIO_MAX_SIZE :
|
||||
io->size);
|
||||
|
||||
bufio = grub_malloc (sizeof (struct grub_bufio) + size);
|
||||
bufio = grub_zalloc (sizeof (struct grub_bufio) + size);
|
||||
if (! bufio)
|
||||
{
|
||||
grub_free (file);
|
||||
|
@ -70,14 +70,10 @@ grub_bufio_open (grub_file_t io, int size)
|
|||
|
||||
bufio->file = io;
|
||||
bufio->block_size = size;
|
||||
bufio->buffer_len = 0;
|
||||
bufio->buffer_at = 0;
|
||||
|
||||
file->device = io->device;
|
||||
file->offset = 0;
|
||||
file->size = io->size;
|
||||
file->data = bufio;
|
||||
file->read_hook = 0;
|
||||
file->fs = &grub_bufio_fs;
|
||||
file->not_easily_seekable = io->not_easily_seekable;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue