]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
fullbench 43: ensure context is freed after each usage
authorYann Collet <cyan@fb.com>
Wed, 29 May 2019 00:27:52 +0000 (17:27 -0700)
committerYann Collet <cyan@fb.com>
Wed, 29 May 2019 00:27:52 +0000 (17:27 -0700)
tests/fullbench.c

index 3340e9b534edcb5e838495f9ca5b11333c794ebf..cd6e745462007343279f7a5ff500391243c410c5 100644 (file)
@@ -166,11 +166,14 @@ local_ZSTD_compressStream_freshCCtx(const void* src, size_t srcSize,
                           void* buff2)
 {
     ZSTD_CCtx* const cctx = ZSTD_createCCtx();
+    size_t r;
     assert(cctx != NULL);
 
-    return local_ZSTD_compressStream(src, srcSize, dst, dstCapacity, buff2);
+    r = local_ZSTD_compressStream(src, srcSize, dst, dstCapacity, buff2);
 
     ZSTD_freeCCtx(cctx);
+
+    return r;
 }
 
 static size_t