From ca6d4093a87c9aa6059ad4e396a50ff485cc0066 Mon Sep 17 00:00:00 2001
From: linyanly <linyanly.lin@huawei.com>
Date: Fri, 3 Nov 2017 15:53:29 +0800
Subject: [PATCH 218/220] backport 'support TPM2.0 in grub2, both legacy and
 efi'

---
 grub-core/kern/emu/mm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/grub-core/kern/emu/mm.c b/grub-core/kern/emu/mm.c
index f262e95..43b31fa 100644
--- a/grub-core/kern/emu/mm.c
+++ b/grub-core/kern/emu/mm.c
@@ -50,7 +50,8 @@ grub_zalloc (grub_size_t size)
 void
 grub_free (void *ptr)
 {
-  free (ptr);
+  if (ptr)
+    free (ptr);
 }
 
 void *
-- 
1.8.3.1

