[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 3/3] grub_unicode_destroy_glyph: Don't destroy NULL glyph
From: |
Vladimir Serbinenko |
Subject: |
[PATCH 3/3] grub_unicode_destroy_glyph: Don't destroy NULL glyph |
Date: |
Thu, 16 May 2024 22:34:44 +0300 |
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