* grub-core/commands/cmp.c (grub_cmd_cmp): Remove unnecessary NULL
pointer checks before calling grub_free(). * grub-core/commands/wildcard.c (match_devices): Likewise. * grub-core/commands/wildcard.c (match_files): Likewise. * grub-core/fs/cpio.c (grub_cpio_dir): Likewise. * grub-core/fs/cpio.c (grub_cpio_open): Likewise. * grub-core/fs/udf.c (grub_udf_read_block): Likewise. * grub-core/fs/xfs.c (grub_xfs_read_block): Likewise. * grub-core/loader/efi/chainloader.c (grub_cmd_chainloader): Likewise. * grub-core/normal/cmdline.c (grub_cmdline_get): Likewise. * grub-core/script/yylex.l (grub_lexer_unput): Likewise. * grub-core/video/readers/jpeg.c (grub_video_reader_jpeg): Likewise. * grub-core/video/readers/png.c (grub_png_output_byte): Likewise.
This commit is contained in:
parent
6295b32f79
commit
cbf597afb1
11 changed files with 34 additions and 37 deletions
|
@ -94,10 +94,8 @@ grub_cmd_cmp (grub_command_t cmd __attribute__ ((unused)),
|
|||
|
||||
cleanup:
|
||||
|
||||
if (buf1)
|
||||
grub_free (buf1);
|
||||
if (buf2)
|
||||
grub_free (buf2);
|
||||
grub_free (buf1);
|
||||
grub_free (buf2);
|
||||
if (file1)
|
||||
grub_file_close (file1);
|
||||
if (file2)
|
||||
|
|
|
@ -255,8 +255,7 @@ match_devices (const regex_t *regexp, int noparts)
|
|||
for (i = 0; devs && devs[i]; i++)
|
||||
grub_free (devs[i]);
|
||||
|
||||
if (devs)
|
||||
grub_free (devs);
|
||||
grub_free (devs);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -342,20 +341,17 @@ match_files (const char *prefix, const char *suffix, const char *end,
|
|||
|
||||
fail:
|
||||
|
||||
if (dir)
|
||||
grub_free (dir);
|
||||
grub_free (dir);
|
||||
|
||||
for (i = 0; files && files[i]; i++)
|
||||
grub_free (files[i]);
|
||||
|
||||
if (files)
|
||||
grub_free (files);
|
||||
grub_free (files);
|
||||
|
||||
if (dev)
|
||||
grub_device_close (dev);
|
||||
|
||||
if (device_name)
|
||||
grub_free (device_name);
|
||||
grub_free (device_name);
|
||||
|
||||
grub_error_pop ();
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue