fix coverity CID 349306 - resource leak
[RRG-proxmark3.git] / common / get_lz4.sh
blob6c2dcf3cb785b9b4b86eafa9ee94dcbb4ff4f374
1 version=1.9.2
2 mkdir -p lz4
3 wget https://github.com/lz4/lz4/archive/v$version.zip
4 unzip -o -j v$version "lz4-$version/LICENSE" "lz4-$version/lib/lz4.h" "lz4-$version/lib/lz4.c" "lz4-$version/lib/lz4hc.h" "lz4-$version/lib/lz4hc.c" -d lz4
5 rm v$version.zip
6 patch -p0 << EOF
7 diff -Naur lz4/lz4.c lz4/lz4.c
8 --- lz4/lz4.c
9 +++ lz4/lz4.c
10 @@ -1270,6 +1270,7 @@ int LZ4_compress_default(const char* src, char* dst, int srcSize, int maxOutputS
14 +int LZ4_compress_fast_force(const char* src, char* dst, int srcSize, int dstCapacity, int acceleration);
15 /* hidden debug function */
16 /* strangely enough, gcc generates faster code when this function is uncommented, even if unused */
17 int LZ4_compress_fast_force(const char* src, char* dst, int srcSize, int dstCapacity, int acceleration)
18 @@ -1644,13 +1645,16 @@ read_variable_length(const BYTE**ip, const BYTE* lencheck, int loop_check, int i
19 return length;
22 +int LZ4_decompress_generic(const char* const src, char* const dst, int srcSize, int outputSize, endCondition_directive endOnInput, earlyEnd_directive partialDecoding,
23 + dict_directive dict, const BYTE* const lowPrefix, const BYTE* const dictStart, const size_t dictSize );
25 /*! LZ4_decompress_generic() :
26 * This generic decompression function covers all use cases.
27 * It shall be instantiated several times, using different sets of directives.
28 * Note that it is important for performance that this function really get inlined,
29 * in order to remove useless branches during compilation optimization.
31 -LZ4_FORCE_INLINE int
32 +int
33 LZ4_decompress_generic(
34 const char* const src,
35 char* const dst,
36 EOF