From f0a53ed2c25347cc1fea509a272b46bac4c6efd5 Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Tue, 1 May 2012 15:06:34 +0200 Subject: [PATCH] * grub-core/normal/autofs.c (read_fs_list): Fix memory leak. --- ChangeLog | 4 ++++ grub-core/normal/autofs.c | 15 +++++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) 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);