summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CryptoPkg/Library/BaseCryptLib/SysCall/RuntimeMemAllocation.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/CryptoPkg/Library/BaseCryptLib/SysCall/RuntimeMemAllocation.c b/CryptoPkg/Library/BaseCryptLib/SysCall/RuntimeMemAllocation.c
index 45ef9ff..413e47e 100644
--- a/CryptoPkg/Library/BaseCryptLib/SysCall/RuntimeMemAllocation.c
+++ b/CryptoPkg/Library/BaseCryptLib/SysCall/RuntimeMemAllocation.c
@@ -396,6 +396,10 @@ void *realloc (void *ptr, size_t size)
UINTN StartPageIndex;
UINTN PageCount;
+ if (ptr == NULL) {
+ return malloc (size);
+ }
+
//
// Get Original Size of ptr
//