aboutsummaryrefslogtreecommitdiff
path: root/src/test3.c
diff options
context:
space:
mode:
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;