From: Bimba Shrestha Date: Mon, 23 Sep 2019 22:42:16 +0000 (-0700) Subject: Replacing assert with memory_allocation error code throw X-Git-Tag: v1.4.4~1^2~38^2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c04245b257e25c26cdb15507308575b1f16108e4;p=thirdparty%2Fzstd.git Replacing assert with memory_allocation error code throw --- diff --git a/lib/compress/zstd_compress.c b/lib/compress/zstd_compress.c index 8eb292894..7facbeff0 100644 --- a/lib/compress/zstd_compress.c +++ b/lib/compress/zstd_compress.c @@ -2323,7 +2323,7 @@ size_t ZSTD_getSequences(ZSTD_CCtx* zc, ZSTD_Sequence* outSeqs, void* dst = ZSTD_malloc(dstCapacity, ZSTD_defaultCMem); SeqCollector seqCollector; - assert(dst != NULL); + RETURN_ERROR_IF(dst == NULL, memory_allocation); seqCollector.collectSequences = 1; seqCollector.seqStart = outSeqs;