summaryrefslogtreecommitdiffstats
path: root/ossfuzz/compress_fuzzer.c
diff options
context:
space:
mode:
Diffstat (limited to 'ossfuzz/compress_fuzzer.c')
-rw-r--r--ossfuzz/compress_fuzzer.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/ossfuzz/compress_fuzzer.c b/ossfuzz/compress_fuzzer.c
index 28610ad..3908534 100644
--- a/ossfuzz/compress_fuzzer.c
+++ b/ossfuzz/compress_fuzzer.c
@@ -10,17 +10,16 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
size_t const compressed_dest_size = LZ4_compressBound(size);
char *const dest_buffer = (char *)malloc(compressed_dest_size);
- if (dest_buffer != NULL)
- {
- // Allocation succeeded, try compressing the incoming data.
- int result = LZ4_compress_default((const char*)data,
- dest_buffer,
- size,
- compressed_dest_size);
- CHECK(result != 0);
+ CHECK(dest_buffer != NULL);
- free(dest_buffer);
- }
+ // Allocation succeeded, try compressing the incoming data.
+ int result = LZ4_compress_default((const char*)data,
+ dest_buffer,
+ size,
+ compressed_dest_size);
+ CHECK(result != 0);
+
+ free(dest_buffer);
return 0;
}