Fix a memory leak in the ".dump" command of the CLI that can occur if an

error other than database corruption is seen while trying to query the
database.

FossilOrigin-Name: 2560cc7072c923f534a5de1e15d2b0dd4ac5faf0a8876d9e3bf9804345585444
This commit is contained in:
drh 2024-11-13 18:04:49 +00:00
parent 31c160ab8f
commit 26c080a04b
3 changed files with 8 additions and 8 deletions

View File

@ -1,5 +1,5 @@
C Add\sthe\stest/fork-test.c\stest\sprogram.
D 2024-11-13T16:08:02.102
C Fix\sa\smemory\sleak\sin\sthe\s".dump"\scommand\sof\sthe\sCLI\sthat\scan\soccur\sif\san\nerror\sother\sthan\sdatabase\scorruption\sis\sseen\swhile\strying\sto\squery\sthe\ndatabase.
D 2024-11-13T18:04:49.647
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d
@ -776,7 +776,7 @@ F src/random.c 606b00941a1d7dd09c381d3279a058d771f406c5213c9932bbd93d5587be4b9c
F src/resolve.c c8a5372b97b2a2e972a280676f06ddb5b74e885d3b1f5ce383f839907b57ef68
F src/rowset.c 8432130e6c344b3401a8874c3cb49fefe6873fec593294de077afea2dce5ec97
F src/select.c 4b14337a2742f0c0beeba490e9a05507e9b4b12184b9cd12773501d08d48e3fe
F src/shell.c.in 2b684d9cdad2351e6cabe25ea3a64ac743eb4cda9837bdbc6096d240c4533ab6
F src/shell.c.in 45e69e4e69576847a5b49aeac624c9ffad5666697ce037d38bc331a56733765f
F src/sqlite.h.in 4d93768709c53b7c653a63817a82d5a8625264ca0d8cdf99967ba147bdcf2aa6
F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8
F src/sqlite3ext.h 3f046c04ea3595d6bfda99b781926b17e672fd6d27da2ba6d8d8fc39981dcb54
@ -2199,8 +2199,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350
F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7
F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
P f0e917fcf51b59f8ccfe5b9341937341d0e6016eb275d6c33dcb10b0b301a9da
R 6602510d12e6c22a0b1d041f1323efab
P 0611e2b0cf3f33c28cc9ff6c5da7ebba2033bcbda5b1072a30021a3e1fb4e738
R ae1e95a303369ff7949c51518d63ae67
U drh
Z a609b555f7a83a611caf3857959d5dfd
Z 5eaa8df8893f82fa2c87e2122f21eb00
# Remove this line to create a well-formed Fossil manifest.

View File

@ -1 +1 @@
0611e2b0cf3f33c28cc9ff6c5da7ebba2033bcbda5b1072a30021a3e1fb4e738
2560cc7072c923f534a5de1e15d2b0dd4ac5faf0a8876d9e3bf9804345585444

View File

@ -4886,9 +4886,9 @@ static int run_schema_dump_query(
}else{
rc = SQLITE_CORRUPT;
}
sqlite3_free(zErr);
free(zQ2);
}
sqlite3_free(zErr);
return rc;
}