diff options
author | Yann Collet <cyan@fb.com> | 2017-08-15 23:57:00 (GMT) |
---|---|---|
committer | Yann Collet <cyan@fb.com> | 2017-08-15 23:57:00 (GMT) |
commit | a1f3a27e9b3caf42d31100f96bbb88866e08a517 (patch) | |
tree | 014922fceee22f63d46a0d04328234c3711f4799 /lib/lz4.c | |
parent | 01cdbfb5feda4adee65cc3da04b426c0c22368a3 (diff) | |
parent | af9d72b7f6809ec972787c446d464a8f9be443ba (diff) | |
download | lz4-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.c | 7 |
1 files changed, 2 insertions, 5 deletions
@@ -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; } |