From: senhuang42 Date: Wed, 28 Oct 2020 20:22:22 +0000 (-0400) Subject: Add check for allocation X-Git-Tag: v1.4.7~40^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=60a52c29e623c71aba56d98c39360425b48d4c12;p=thirdparty%2Fzstd.git Add check for allocation --- diff --git a/tests/fuzzer.c b/tests/fuzzer.c index eb1b28c1c..c2f5d5707 100644 --- a/tests/fuzzer.c +++ b/tests/fuzzer.c @@ -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);