diff --git a/ChangeLog b/ChangeLog index ec61fa063..9c06c24ba 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2012-05-01 Vladimir Serbinenko + + * grub-core/normal/autofs.c (read_fs_list): Fix memory leak. + 2012-05-01 Vladimir Serbinenko Handle RAIDZ on non-512B sectors. diff --git a/grub-core/normal/autofs.c b/grub-core/normal/autofs.c index 8af2a95fd..80f395bc0 100644 --- a/grub-core/normal/autofs.c +++ b/grub-core/normal/autofs.c @@ -104,13 +104,20 @@ read_fs_list (const char *prefix) /* If the line is empty, skip it. */ if (p >= q) - continue; + { + grub_free (buf); + continue; + } - fs_mod = grub_malloc (sizeof (*fs_mod)); + fs_mod = grub_malloc_notrack (sizeof (*fs_mod)); if (! fs_mod) - continue; + { + grub_free (buf); + continue; + } - fs_mod->name = grub_strdup (p); + fs_mod->name = grub_strdup_notrack (p); + grub_free (buf); if (! fs_mod->name) { grub_free (fs_mod);