]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Replacing assert with memory_allocation error code throw
authorBimba Shrestha <bimbashrestha@fb.com>
Mon, 23 Sep 2019 22:42:16 +0000 (15:42 -0700)
committerBimba Shrestha <bimbashrestha@fb.com>
Mon, 23 Sep 2019 22:42:16 +0000 (15:42 -0700)
lib/compress/zstd_compress.c

index 8eb29289497d59d41ad52b1c6e07c2f06a78bedd..7facbeff0a11e982d3ea6a5e2c7381f52d516db0 100644 (file)
@@ -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;