From: Darren Kenny <darren.ke...@oracle.com>

In syslinux_parse_real() the 2 points where return is being called
didn't release the memory stored in buf which is no longer required.

Fixes: CID 176634

Signed-off-by: Darren Kenny <darren.ke...@oracle.com>
Reviewed-by: Daniel Kiper <daniel.ki...@oracle.com>
---
 grub-core/lib/syslinux_parse.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/grub-core/lib/syslinux_parse.c b/grub-core/lib/syslinux_parse.c
index de9fda06f..ff244d2e0 100644
--- a/grub-core/lib/syslinux_parse.c
+++ b/grub-core/lib/syslinux_parse.c
@@ -737,7 +737,10 @@ syslinux_parse_real (struct syslinux_menu *menu)
                  && grub_strncasecmp ("help", ptr3, ptr4 - ptr3) == 0))
            {
              if (helptext (ptr5, file, menu))
-               return 1;
+               {
+                 grub_free (buf);
+                 return 1;
+               }
              continue;
            }
 
@@ -757,6 +760,7 @@ syslinux_parse_real (struct syslinux_menu *menu)
     }
  fail:
   grub_file_close (file);
+  grub_free (buf);
   return err;
 }
 
-- 
2.11.0


_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to