Fix a malloc/sqlite3_free mismatch in the shell tool code.

FossilOrigin-Name: fe053b2ecdc04b918367fa503bf10292fd7cd84a6929670857b2e9153df4d1f9
This commit is contained in:
dan 2018-01-08 17:05:32 +00:00
parent 98dfb2fc08
commit dcfbff9a86
3 changed files with 13 additions and 11 deletions

View File

@ -1,5 +1,5 @@
C Fix\scompilation\sof\s'sqltclsh.exe'\sfor\sMSVC.
D 2018-01-08T14:24:08.629
C Fix\sa\smalloc/sqlite3_free\smismatch\sin\sthe\sshell\stool\scode.
D 2018-01-08T17:05:32.727
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F Makefile.in 12b6daa4bdb03fa87da27cbc205ff88ace645475b5be79414a3038b68ade14cb
@ -484,7 +484,7 @@ F src/random.c 80f5d666f23feb3e6665a6ce04c7197212a88384
F src/resolve.c bbee7e31d369a18a2f4836644769882e9c5d40ef4a3af911db06410b65cb3730
F src/rowset.c 7b7e7e479212e65b723bf40128c7b36dc5afdfac
F src/select.c 8b22abe193e4d8243befa2038e4ae2405802fed1c446e5e502d11f652e09ba74
F src/shell.c.in 0e20ac49a6c4458620084bf7715ad39cd9557d9116e447548d2282000e8ca361
F src/shell.c.in be04d6797b4ee066f064dc370bdcb148c84c6c6979bf12f70025a7a89cf79346
F src/sqlite.h.in 1f1a2da222ec57465794e8984d77f32d0bd0da80cdc136beadda461a0be9d80c
F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8
F src/sqlite3ext.h c02d628cca67f3889c689d82d25c3eb45e2c155db08e4c6089b5840d64687d34
@ -1697,7 +1697,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
P 90cb01d8d6ac12d0b88f2952a75aeefa81ba66f5e4a5377fdd8b9f86aec8e927
R 76adb99cb262a63e3f8964691f33ecc1
U mistachkin
Z 00d4b6b04e6e70aa614f01ae7c47411b
P abb112d9e1a51c1c2f15d1e5f3dc161c9a947841f69a56715f5f1c62603096b2
R 97c2ea02cbe64fb40daf371bd5a56946
U dan
Z dc8bc5606c8c9f2e7de507a70d755d15

View File

@ -1 +1 @@
abb112d9e1a51c1c2f15d1e5f3dc161c9a947841f69a56715f5f1c62603096b2
fe053b2ecdc04b918367fa503bf10292fd7cd84a6929670857b2e9153df4d1f9

View File

@ -802,8 +802,9 @@ static void shellModuleSchema(
const char *zName = (const char*)sqlite3_value_text(apVal[0]);
char *zFake = shellFakeSchema(sqlite3_context_db_handle(pCtx), 0, zName);
if( zFake ){
sqlite3_result_text(pCtx, sqlite3_mprintf("/* %z */", zFake),
sqlite3_result_text(pCtx, sqlite3_mprintf("/* %s */", zFake),
-1, sqlite3_free);
free(zFake);
}
}
@ -863,10 +864,11 @@ static void shellAddSchemaName(
&& (zFake = shellFakeSchema(db, zSchema, zName))!=0
){
if( z==0 ){
z = sqlite3_mprintf("%s\n/* %z */", zIn, zFake);
z = sqlite3_mprintf("%s\n/* %s */", zIn, zFake);
}else{
z = sqlite3_mprintf("%z\n/* %z */", z, zFake);
z = sqlite3_mprintf("%z\n/* %s */", z, zFake);
}
free(zFake);
}
if( z ){
sqlite3_result_text(pCtx, z, -1, sqlite3_free);