* kern/env.c (grub_register_variable_hook): Don't copy empty
string, it leaks memory. Pass "" to grub_env_set(), it should
handle constant strings.
2008-07-14 Pavel Roskin <proski@gnu.org>
+ * kern/env.c (grub_register_variable_hook): Don't copy empty
+ string, it leaks memory. Pass "" to grub_env_set(), it should
+ handle constant strings.
+
* commands/blocklist.c (grub_cmd_blocklist): Fix format warning.
* commands/cmp.c (grub_cmd_cmp): Likewise.
* kern/dl.c (grub_dl_flush_cache): Likewise.
if (! var)
{
- char *val = grub_strdup ("");
-
- if (! val)
- return grub_errno;
-
- if (grub_env_set (name, val) != GRUB_ERR_NONE)
+ if (grub_env_set (name, "") != GRUB_ERR_NONE)
return grub_errno;
var = grub_env_find (name);