summaryrefslogtreecommitdiffstats
path: root/lib/lz4.c
diff options
context:
space:
mode:
authorYann Collet <cyan@fb.com>2017-08-15 23:57:00 (GMT)
committerYann Collet <cyan@fb.com>2017-08-15 23:57:00 (GMT)
commita1f3a27e9b3caf42d31100f96bbb88866e08a517 (patch)
tree014922fceee22f63d46a0d04328234c3711f4799 /lib/lz4.c
parent01cdbfb5feda4adee65cc3da04b426c0c22368a3 (diff)
parentaf9d72b7f6809ec972787c446d464a8f9be443ba (diff)
downloadlz4-a1f3a27e9b3caf42d31100f96bbb88866e08a517.zip
lz4-a1f3a27e9b3caf42d31100f96bbb88866e08a517.tar.gz
lz4-a1f3a27e9b3caf42d31100f96bbb88866e08a517.tar.bz2
Merge branch 'dev' into installVars and fixed conflicts
Diffstat (limited to 'lib/lz4.c')
-rw-r--r--lib/lz4.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/lz4.c b/lib/lz4.c
index 62e4dc2..41c0a28 100644
--- a/lib/lz4.c
+++ b/lib/lz4.c
@@ -945,6 +945,7 @@ void LZ4_resetStream (LZ4_stream_t* LZ4_stream)
int LZ4_freeStream (LZ4_stream_t* LZ4_stream)
{
+ if (!LZ4_stream) return 0; /* support free on NULL */
FREEMEM(LZ4_stream);
return (0);
}
@@ -1284,11 +1285,6 @@ int LZ4_decompress_fast(const char* source, char* dest, int originalSize)
/*===== streaming decompression functions =====*/
-/*
- * If you prefer dynamic allocation methods,
- * LZ4_createStreamDecode()
- * provides a pointer (void*) towards an initialized LZ4_streamDecode_t structure.
- */
LZ4_streamDecode_t* LZ4_createStreamDecode(void)
{
LZ4_streamDecode_t* lz4s = (LZ4_streamDecode_t*) ALLOCATOR(1, sizeof(LZ4_streamDecode_t));
@@ -1297,6 +1293,7 @@ LZ4_streamDecode_t* LZ4_createStreamDecode(void)
int LZ4_freeStreamDecode (LZ4_streamDecode_t* LZ4_stream)
{
+ if (!LZ4_stream) return 0; /* support free on NULL */
FREEMEM(LZ4_stream);
return 0;
}