lz4hc : added one malloc test

This commit is contained in:
Yann Collet 2015-06-28 19:51:11 -08:00
parent 6fe48b9183
commit aa1350e139

View File

@ -701,6 +701,7 @@ int LZ4_resetStreamStateHC(void* state, char* inputBuffer)
void* LZ4_createHC (char* inputBuffer)
{
void* hc4 = ALLOCATOR(1, sizeof(LZ4HC_Data_Structure));
if (hc4 == NULL) return NULL; /* not enough memory */
LZ4HC_init ((LZ4HC_Data_Structure*)hc4, (const BYTE*)inputBuffer);
((LZ4HC_Data_Structure*)hc4)->inputBuffer = (BYTE*)inputBuffer;
return hc4;