[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 2/2] kern: Ensure that parser allocated memory is not leaked
From: |
Daniel Kiper |
Subject: |
Re: [PATCH 2/2] kern: Ensure that parser allocated memory is not leaked |
Date: |
Wed, 16 Mar 2022 19:19:21 +0100 |
User-agent: |
NeoMutt/20170113 (1.7.2) |
On Wed, Mar 16, 2022 at 05:25:05PM +0000, Darren Kenny wrote:
> While it would appear unlikely that the memory allocated in *argv in
> grub_parser_split_cmdline() would be leaked, we should try ensure that
> it doesn't leak by calling grub_free() before we return from
> grub_rescue_parse_line().
>
> To avoid a possible double-free, grub_parser_split_cmdline() is being
> changed to assign *argv = NULL when we've called grub_free() in the fail
> section.
>
> Fixes: CID 96680
>
> Signed-off-by: Darren Kenny <darren.kenny@oracle.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Daniel