* 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
16
ChangeLog
16
ChangeLog
|
@ -1,3 +1,19 @@
|
|||
2011-06-26 Szymon Janc <szymon@janc.net.pl>
|
||||
|
||||
* 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.
|
||||
|
||||
2011-06-25 Patrick <p55@mailinator.com>
|
||||
|
||||
* grub-core/kern/main.c (grub_load_normal_mode): Correct the comment.
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -239,8 +239,7 @@ grub_cpio_dir (grub_device_t device, const char *path,
|
|||
info.mtimeset = 1;
|
||||
|
||||
hook (name + len, &info);
|
||||
if (prev)
|
||||
grub_free (prev);
|
||||
grub_free (prev);
|
||||
prev = name;
|
||||
}
|
||||
else
|
||||
|
@ -251,11 +250,8 @@ grub_cpio_dir (grub_device_t device, const char *path,
|
|||
|
||||
fail:
|
||||
|
||||
if (prev)
|
||||
grub_free (prev);
|
||||
|
||||
if (data)
|
||||
grub_free (data);
|
||||
grub_free (prev);
|
||||
grub_free (data);
|
||||
|
||||
grub_dl_unref (my_mod);
|
||||
|
||||
|
@ -326,8 +322,7 @@ grub_cpio_open (grub_file_t file, const char *name)
|
|||
|
||||
fail:
|
||||
|
||||
if (data)
|
||||
grub_free (data);
|
||||
grub_free (data);
|
||||
|
||||
grub_dl_unref (my_mod);
|
||||
|
||||
|
|
|
@ -546,8 +546,7 @@ grub_udf_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock)
|
|||
}
|
||||
|
||||
fail:
|
||||
if (buf)
|
||||
grub_free (buf);
|
||||
grub_free (buf);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -324,8 +324,7 @@ grub_xfs_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock)
|
|||
}
|
||||
}
|
||||
|
||||
if (leaf)
|
||||
grub_free (leaf);
|
||||
grub_free (leaf);
|
||||
|
||||
return GRUB_XFS_FSB_TO_BLOCK(node->data, ret);
|
||||
}
|
||||
|
|
|
@ -329,8 +329,7 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)),
|
|||
if (file)
|
||||
grub_file_close (file);
|
||||
|
||||
if (file_path)
|
||||
grub_free (file_path);
|
||||
grub_free (file_path);
|
||||
|
||||
if (address)
|
||||
efi_call_2 (b->free_pages, address, pages);
|
||||
|
|
|
@ -500,8 +500,7 @@ grub_cmdline_get (const char *prompt)
|
|||
case GRUB_TERM_CTRL | 'k':
|
||||
if (lpos < llen)
|
||||
{
|
||||
if (kill_buf)
|
||||
grub_free (kill_buf);
|
||||
grub_free (kill_buf);
|
||||
|
||||
kill_buf = grub_malloc ((llen - lpos + 1)
|
||||
* sizeof (grub_uint32_t));
|
||||
|
@ -566,8 +565,7 @@ grub_cmdline_get (const char *prompt)
|
|||
{
|
||||
grub_size_t n = lpos;
|
||||
|
||||
if (kill_buf)
|
||||
grub_free (kill_buf);
|
||||
grub_free (kill_buf);
|
||||
|
||||
kill_buf = grub_malloc (n + 1);
|
||||
if (grub_errno)
|
||||
|
|
|
@ -355,8 +355,7 @@ grub_lexer_unput (const char *text, yyscan_t yyscanner)
|
|||
{
|
||||
struct grub_lexer_param *lexerstate = yyget_extra (yyscanner)->lexerstate;
|
||||
|
||||
if (lexerstate->prefix)
|
||||
grub_free (lexerstate->prefix);
|
||||
grub_free (lexerstate->prefix);
|
||||
|
||||
lexerstate->prefix = grub_strdup (text);
|
||||
if (! lexerstate->prefix)
|
||||
|
|
|
@ -750,8 +750,7 @@ grub_video_reader_jpeg (struct grub_video_bitmap **bitmap,
|
|||
grub_jpeg_decode_jpeg (data);
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
if (data->huff_value[i])
|
||||
grub_free (data->huff_value[i]);
|
||||
grub_free (data->huff_value[i]);
|
||||
|
||||
grub_free (data);
|
||||
}
|
||||
|
|
|
@ -625,8 +625,7 @@ grub_png_output_byte (struct grub_png_data *data, grub_uint8_t n)
|
|||
}
|
||||
}
|
||||
|
||||
if (blank_line)
|
||||
grub_free (blank_line);
|
||||
grub_free (blank_line);
|
||||
|
||||
data->cur_column = 0;
|
||||
data->first_line = 0;
|
||||
|
|
Loading…
Reference in a new issue