1
0
mirror of https://github.com/facebook/zstd.git synced 2025-03-06 16:56:49 +02:00

Add check for allocation

This commit is contained in:
senhuang42 2020-10-28 16:22:22 -04:00
parent 169fc07aa1
commit 60a52c29e6

View File

@ -721,6 +721,11 @@ static int basicUnitTests(U32 const seed, double compressibility)
DISPLAYLEVEL(3, "test%3i : LDM + opt parser with small uncompressible block ", testNb++);
{ ZSTD_CCtx* cctx = ZSTD_createCCtx();
ZSTD_DCtx* dctx = ZSTD_createDCtx();
if (!cctx || !dctx) {
DISPLAY("Not enough memory, aborting\n");
testResult = 1;
goto _end;
}
size_t const srcSize = 300 KB;
size_t const flushSize = 128 KB + 5;
size_t const dstSize = ZSTD_compressBound(srcSize);