aboutsummaryrefslogtreecommitdiff
path: root/src/test3.c
diff options
context:
space:
mode:
authordanielk1977 <danielk1977@noemail.net>2008-03-25 09:47:35 +0000
committerdanielk1977 <danielk1977@noemail.net>2008-03-25 09:47:35 +0000
commitcd3e8f7ce94b2c87ceeeb3da3e2344e1397ec2ab (patch)
tree6c4d2fa51268edffef783bec9a2f9c689871b82e /src/test3.c
parent1e968a0cbf30ea1b0f4d4c5927a8b173d36956d9 (diff)
downloadsqlite-cd3e8f7ce94b2c87ceeeb3da3e2344e1397ec2ab.tar.gz
sqlite-cd3e8f7ce94b2c87ceeeb3da3e2344e1397ec2ab.zip
Use a vdbe memory cell to allocate the space required for vdbe cursors. (CVS 4912)
FossilOrigin-Name: 047153648155654b0cd70b811935209d2e21776c
Diffstat (limited to 'src/test3.c')
-rw-r--r--src/test3.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/test3.c b/src/test3.c
index 8a907070b..e3922f67d 100644
--- a/src/test3.c
+++ b/src/test3.c
@@ -13,7 +13,7 @@
** is not included in the SQLite library. It is used for automated
** testing of the SQLite library.
**
-** $Id: test3.c,v 1.92 2008/03/25 00:22:21 drh Exp $
+** $Id: test3.c,v 1.93 2008/03/25 09:47:35 danielk1977 Exp $
*/
#include "sqliteInt.h"
#include "btreeInt.h"
@@ -711,10 +711,13 @@ static int btree_cursor(
pBt = sqlite3TextToPtr(argv[1]);
if( Tcl_GetInt(interp, argv[2], &iTable) ) return TCL_ERROR;
if( Tcl_GetBoolean(interp, argv[3], &wrFlag) ) return TCL_ERROR;
+ pCur = (BtCursor *)ckalloc(sqlite3BtreeCursorSize());
+ memset(pCur, 0, sqlite3BtreeCursorSize());
sqlite3BtreeEnter(pBt);
- rc = sqlite3BtreeCursor(pBt, iTable, wrFlag, 0, &pCur);
+ rc = sqlite3BtreeCursor(pBt, iTable, wrFlag, 0, pCur);
sqlite3BtreeLeave(pBt);
if( rc ){
+ ckfree((char *)pCur);
Tcl_AppendResult(interp, errorName(rc), 0);
return TCL_ERROR;
}
@@ -748,6 +751,7 @@ static int btree_close_cursor(
sqlite3BtreeEnter(pBt);
rc = sqlite3BtreeCloseCursor(pCur);
sqlite3BtreeLeave(pBt);
+ ckfree((char *)pCur);
if( rc ){
Tcl_AppendResult(interp, errorName(rc), 0);
return TCL_ERROR;