konradr / rpms / grub2

Forked from rpms/grub2 6 years ago
Clone
Blob Blame History Raw
From aa64393144f0a805b191bc2c45b84606b03706a0 Mon Sep 17 00:00:00 2001
From: Vladimir Serbinenko <phcoder@gmail.com>
Date: Mon, 26 Jan 2015 09:40:42 +0100
Subject: [PATCH 223/506] lib/syslinux_parse: Add missing alloc check.

Found by: Coverity scan.
---
 grub-core/lib/syslinux_parse.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/grub-core/lib/syslinux_parse.c b/grub-core/lib/syslinux_parse.c
index 241cefe..2f1f1a5 100644
--- a/grub-core/lib/syslinux_parse.c
+++ b/grub-core/lib/syslinux_parse.c
@@ -649,6 +649,8 @@ helptext (const char *line, grub_file_t file, struct syslinux_menu *menu)
   grub_size_t helplen, alloclen = 0;
 
   help = grub_strdup (line);
+  if (!help)
+    return grub_errno;
   helplen = grub_strlen (line);
   while ((grub_free (buf), buf = grub_file_getline (file)))
     {
-- 
2.4.3