Add check for allocation
This commit is contained in:
@@ -721,6 +721,11 @@ static int basicUnitTests(U32 const seed, double compressibility)
|
|||||||
DISPLAYLEVEL(3, "test%3i : LDM + opt parser with small uncompressible block ", testNb++);
|
DISPLAYLEVEL(3, "test%3i : LDM + opt parser with small uncompressible block ", testNb++);
|
||||||
{ ZSTD_CCtx* cctx = ZSTD_createCCtx();
|
{ ZSTD_CCtx* cctx = ZSTD_createCCtx();
|
||||||
ZSTD_DCtx* dctx = ZSTD_createDCtx();
|
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 srcSize = 300 KB;
|
||||||
size_t const flushSize = 128 KB + 5;
|
size_t const flushSize = 128 KB + 5;
|
||||||
size_t const dstSize = ZSTD_compressBound(srcSize);
|
size_t const dstSize = ZSTD_compressBound(srcSize);
|
||||||
|
|||||||
Reference in New Issue
Block a user