diff options
author | 2015-04-19 14:21:33 +0000 | |
---|---|---|
committer | 2015-04-19 14:21:33 +0000 | |
commit | 195e5996de6de62491ca3cfe673e94ad6087aad7 (patch) | |
tree | 4ee42085a9591772cf064f0d1a9b78ecd61e7c61 /lib/libsqlite3/ext/misc/compress.c | |
parent | Decouple the token code for "no request or macro" from the individual (diff) | |
download | wireguard-openbsd-195e5996de6de62491ca3cfe673e94ad6087aad7.tar.xz wireguard-openbsd-195e5996de6de62491ca3cfe673e94ad6087aad7.zip |
Update sqlite3 to 3.8.9. Changes available here:
http://sqlite.org/releaselog/3_8_9.html
Tested in bulk and ok landry@
Diffstat (limited to 'lib/libsqlite3/ext/misc/compress.c')
-rw-r--r-- | lib/libsqlite3/ext/misc/compress.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/libsqlite3/ext/misc/compress.c b/lib/libsqlite3/ext/misc/compress.c index a4059116c9e..bf38d4c93cf 100644 --- a/lib/libsqlite3/ext/misc/compress.c +++ b/lib/libsqlite3/ext/misc/compress.c @@ -38,6 +38,7 @@ static void compressFunc( unsigned int nIn; unsigned long int nOut; unsigned char x[8]; + int rc; int i, j; pIn = sqlite3_value_blob(argv[0]); @@ -50,8 +51,12 @@ static void compressFunc( for(i=0; i<4 && x[i]==0; i++){} for(j=0; i<=4; i++, j++) pOut[j] = x[i]; pOut[j-1] |= 0x80; - compress(&pOut[j], &nOut, pIn, nIn); - sqlite3_result_blob(context, pOut, nOut+j, sqlite3_free); + rc = compress(&pOut[j], &nOut, pIn, nIn); + if( rc==Z_OK ){ + sqlite3_result_blob(context, pOut, nOut+j, sqlite3_free); + }else{ + sqlite3_free(pOut); + } } /* @@ -82,6 +87,8 @@ static void uncompressFunc( rc = uncompress(pOut, &nOut, &pIn[i], nIn-i); if( rc==Z_OK ){ sqlite3_result_blob(context, pOut, nOut, sqlite3_free); + }else{ + sqlite3_free(pOut); } } |