unsigned int nIn;
unsigned long int nOut;
unsigned char x[8];
+ int rc;
int i, j;
pIn = sqlite3_value_blob(argv[0]);
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);
+ }
}
/*
rc = uncompress(pOut, &nOut, &pIn[i], nIn-i);
if( rc==Z_OK ){
sqlite3_result_blob(context, pOut, nOut, sqlite3_free);
+ }else{
+ sqlite3_free(pOut);
}
}
-C Update\sa\srequirements\smark\sto\sreflect\sa\schange\sof\swording\sin\sthe\sdocumentation.\nNo\schanges\sto\scode.
-D 2015-02-26T16:40:41.460
+C Fix\spotential\smemory\sleaks\sin\sthe\smisc\s'compress'\sextension.
+D 2015-02-26T21:04:44.709
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in 6b9e7677829aa94b9f30949656e27312aefb9a46
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
F ext/icu/sqliteicu.h 728867a802baa5a96de7495e9689a8e01715ef37
F ext/misc/amatch.c 27b9b601fb1453084e18a3432ea0240d7af8decb
F ext/misc/closure.c 636024302cde41b2bf0c542f81c40c624cfb7012
-F ext/misc/compress.c 76e45655f4046e756064ab10c62e18f2eb846b9f
+F ext/misc/compress.c 122faa92d25033d6c3f07c39231de074ab3d2e83
F ext/misc/eval.c f971962e92ebb8b0a4e6b62949463ee454d88fa2
F ext/misc/fileio.c d4171c815d6543a9edef8308aab2951413cd8d0f
F ext/misc/fuzzer.c e3e18f47252c151b5553d7e806f38e757d37c4cc
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P a62ba58c737656fae620d9cdaaae299104ac06f6
-R 10478383687ae87f2012aeaa926b3297
-U drh
-Z ebf66855f11c3f65a39c6b4bb93adf68
+P 3038d0169bfc3f63d64c7fef20ab2323d032655f
+R 92275b863621a447a1ee2bc5287be291
+U mistachkin
+Z 13fe93e6bf28cbbfddb5268264090ce6