diff options
author | Yann Collet <Cyan4973@users.noreply.github.com> | 2017-08-15 21:12:04 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-15 21:12:04 (GMT) |
commit | 8593ba8831fb4698731c60391aa0ab89b32e9e19 (patch) | |
tree | 660ffcd8c653e701771534b9109de460e47e606a /lib/lz4.c | |
parent | 228e26ee63818c22ea9c4aff0eb47d82306d44e5 (diff) | |
parent | 757497ae3db93a78d146ff573ae267f54e49c9b6 (diff) | |
download | lz4-8593ba8831fb4698731c60391aa0ab89b32e9e19.zip lz4-8593ba8831fb4698731c60391aa0ab89b32e9e19.tar.gz lz4-8593ba8831fb4698731c60391aa0ab89b32e9e19.tar.bz2 |
Merge pull request #380 from lz4/dictID
Frame Dictionary API
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; } |