1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-14 00:22:38 +03:00

Fix a memory leak that can occur following a malloc() failure. (CVS 4628)

FossilOrigin-Name: 993a213024964f4411a9c25c10810543c8089d07
This commit is contained in:
danielk1977
2007-12-13 19:15:02 +00:00
parent f78fbded4c
commit 31da1d796b
3 changed files with 10 additions and 9 deletions

View File

@@ -1,5 +1,5 @@
C Fix\sthe\slocation\sof\sa\s#include\sin\stest_thread.c.\s\sticket\s#2826.\s(CVS\s4627) C Fix\sa\smemory\sleak\sthat\scan\soccur\sfollowing\sa\smalloc()\sfailure.\s(CVS\s4628)
D 2007-12-13T18:29:36 D 2007-12-13T19:15:03
F Makefile.arm-wince-mingw32ce-gcc ac5f7b2cef0cd850d6f755ba6ee4ab961b1fadf7 F Makefile.arm-wince-mingw32ce-gcc ac5f7b2cef0cd850d6f755ba6ee4ab961b1fadf7
F Makefile.in e66cf1239b8009b073156b36f92e68657d4755da F Makefile.in e66cf1239b8009b073156b36f92e68657d4755da
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@@ -131,7 +131,7 @@ F src/pragma.c 0246032dbe681dded8710ac43eaf654eead1434e
F src/prepare.c f811fdb6fd4a82cca673a6e1d5b041d6caf567f1 F src/prepare.c f811fdb6fd4a82cca673a6e1d5b041d6caf567f1
F src/printf.c eb27822ba2eec669161409ca31279a24c26ac910 F src/printf.c eb27822ba2eec669161409ca31279a24c26ac910
F src/random.c 4a22746501bf36b0a088c66e38dde5daba6a35da F src/random.c 4a22746501bf36b0a088c66e38dde5daba6a35da
F src/select.c 14c4a8e9d784bfc4bfbb1576226f2bc0b9fbfd10 F src/select.c 7eedf1fc810aa634aa625d07b172f6f1d63126b4
F src/server.c 087b92a39d883e3fa113cae259d64e4c7438bc96 F src/server.c 087b92a39d883e3fa113cae259d64e4c7438bc96
F src/shell.c c97be281cfc3dcb14902f45e4b16f20038eb83ff F src/shell.c c97be281cfc3dcb14902f45e4b16f20038eb83ff
F src/sqlite.h.in b16a7127dad4a3e5b1b26b3d64241f3373aa12ea F src/sqlite.h.in b16a7127dad4a3e5b1b26b3d64241f3373aa12ea
@@ -600,7 +600,7 @@ F www/tclsqlite.tcl 8be95ee6dba05eabcd27a9d91331c803f2ce2130
F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b
F www/whentouse.tcl fc46eae081251c3c181bd79c5faef8195d7991a5 F www/whentouse.tcl fc46eae081251c3c181bd79c5faef8195d7991a5
P 49b67adfe9f15dfac34cb30f965920bf61bceee7 P 6129fce873da5adb05473129e610198a30e43ac8
R 6fead2df8c6a290b78ec55564e2f4b5d R c94e2287b85c030d5ecb43fa975ab920
U drh U danielk1977
Z d1655bfb7a138064325a9c5e291da80a Z 18c07b61bb74a95bf1b1340e5ca961dc

View File

@@ -1 +1 @@
6129fce873da5adb05473129e610198a30e43ac8 993a213024964f4411a9c25c10810543c8089d07

View File

@@ -12,7 +12,7 @@
** This file contains C code routines that are called by the parser ** This file contains C code routines that are called by the parser
** to handle SELECT statements in SQLite. ** to handle SELECT statements in SQLite.
** **
** $Id: select.c,v 1.368 2007/12/13 07:58:51 danielk1977 Exp $ ** $Id: select.c,v 1.369 2007/12/13 19:15:03 danielk1977 Exp $
*/ */
#include "sqliteInt.h" #include "sqliteInt.h"
@@ -1465,6 +1465,7 @@ static int matchOrderByTermToExprList(
sqlite3 *db = pParse->db; sqlite3 *db = pParse->db;
char *zCol = sqlite3NameFromToken(db, &pE->token); char *zCol = sqlite3NameFromToken(db, &pE->token);
if( db->mallocFailed ){ if( db->mallocFailed ){
sqlite3_free(zCol);
return -1; return -1;
} }
for(i=0; i<pEList->nExpr; i++){ for(i=0; i<pEList->nExpr; i++){