grub-devel.gnu.org archive mirror
 help / color / mirror / Atom feed
From: Vladimir Serbinenko <phcoder@gmail.com>
To: grub-devel@gnu.org
Cc: Vladimir Serbinenko <phcoder@gmail.com>
Subject: [PATCH 3/3] grub_unicode_destroy_glyph: Don't destroy NULL glyph
Date: Thu, 16 May 2024 22:34:44 +0300	[thread overview]
Message-ID: <20240516193444.4750-3-phcoder@gmail.com> (raw)
In-Reply-To: <20240516193444.4750-1-phcoder@gmail.com>

This is more in-line with free() behaviour.

Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com>
---
 include/grub/unicode.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/grub/unicode.h b/include/grub/unicode.h
index 9360b0b97..9a3a1d02a 100644
--- a/include/grub/unicode.h
+++ b/include/grub/unicode.h
@@ -281,6 +281,8 @@ grub_unicode_get_comb (const struct grub_unicode_glyph *in)
 static inline void
 grub_unicode_destroy_glyph (struct grub_unicode_glyph *glyph)
 {
+  if (!glyph)
+    return;
   if (glyph->ncomb > ARRAY_SIZE (glyph->combining_inline))
     grub_free (glyph->combining_ptr);
   glyph->ncomb = 0;
-- 
2.39.2


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

      parent reply	other threads:[~2024-05-16 19:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-16 19:34 [PATCH 1/3] Decrease minimal gfxterm size to 10x6 Vladimir Serbinenko
2024-05-16 19:34 ` [PATCH 2/3] Don't attempt to do terminal functions on non-functional gfxterm Vladimir Serbinenko
2024-05-16 19:34 ` Vladimir Serbinenko [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240516193444.4750-3-phcoder@gmail.com \
    --to=phcoder@gmail.com \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).