X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=CryptoPkg%2FLibrary%2FBaseCryptLib%2FSysCall%2FCrtWrapper.c;h=fb446b677044c35764c9e86bf1c7e8782ced1901;hp=7b3dda70e0941242e5b53af89d9bb878aaeca6df;hb=b7d320f8117ed2fffe001b1a0b7bfcd4f40fafc4;hpb=f114914b39c03f6af3173ba3aae09395ed65faaa diff --git a/CryptoPkg/Library/BaseCryptLib/SysCall/CrtWrapper.c b/CryptoPkg/Library/BaseCryptLib/SysCall/CrtWrapper.c index 7b3dda70e0..fb446b6770 100644 --- a/CryptoPkg/Library/BaseCryptLib/SysCall/CrtWrapper.c +++ b/CryptoPkg/Library/BaseCryptLib/SysCall/CrtWrapper.c @@ -18,7 +18,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. int errno = 0; FILE *stderr = NULL; -FILE *stdin = NULL; +FILE *stdin = NULL; FILE *stdout = NULL; typedef @@ -244,7 +244,10 @@ void qsort (void *base, size_t num, size_t width, int (*compare)(const void *, c ASSERT (base != NULL); ASSERT (compare != NULL); - Buffer = AllocatePool (width); + // + // Use CRT-style malloc to cover BS and RT memory allocation. + // + Buffer = malloc (width); ASSERT (Buffer != NULL); // @@ -252,7 +255,7 @@ void qsort (void *base, size_t num, size_t width, int (*compare)(const void *, c // QuickSortWorker (base, (UINTN)num, (UINTN)width, (SORT_COMPARE)compare, Buffer); - FreePool (Buffer); + free (Buffer); return; }