From: Vladimir 'phcoder' Serbinenko Date: Tue, 1 May 2012 13:06:34 +0000 (+0200) Subject: * grub-core/normal/autofs.c (read_fs_list): Fix memory leak. X-Git-Tag: 2.00~287 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f0a53ed2c25347cc1fea509a272b46bac4c6efd5;p=thirdparty%2Fgrub.git * grub-core/normal/autofs.c (read_fs_list): Fix memory leak. --- 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);