/ Check-in [6521ee5f]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:In test code, always use sqlite3_free() instead of free() to free error messages returned by sqlite3_exec(). (CVS 3303)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:6521ee5f320e47f8fbd7d6b23929fab431023483
User & Date: danielk1977 2006-06-27 07:34:40
Context
2006-06-27
11:14
Move older news items to the oldnews.html page. (CVS 3304) check-in: 80163ded user: drh tags: trunk
07:34
In test code, always use sqlite3_free() instead of free() to free error messages returned by sqlite3_exec(). (CVS 3303) check-in: 6521ee5f user: danielk1977 tags: trunk
02:36
Make sure that MATCH terms that a virtual table says should be omitted really are omitted. (CVS 3302) check-in: 3e1f5567 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/test1.c.

     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   *************************************************************************
    12     12   ** Code for testing all sorts of SQLite interfaces.  This code
    13     13   ** is not included in the SQLite library.  It is used for automated
    14     14   ** testing of the SQLite library.
    15     15   **
    16         -** $Id: test1.c,v 1.212 2006/06/20 11:01:08 danielk1977 Exp $
           16  +** $Id: test1.c,v 1.213 2006/06/27 07:34:40 danielk1977 Exp $
    17     17   */
    18     18   #include "sqliteInt.h"
    19     19   #include "tcl.h"
    20     20   #include "os.h"
    21     21   #include <stdlib.h>
    22     22   #include <string.h>
    23     23   
................................................................................
   218    218     zSql = sqlite3_mprintf(argv[2], argv[3]);
   219    219     rc = sqlite3_exec(db, zSql, exec_printf_cb, &str, &zErr);
   220    220     sqlite3_free(zSql);
   221    221     sprintf(zBuf, "%d", rc);
   222    222     Tcl_AppendElement(interp, zBuf);
   223    223     Tcl_AppendElement(interp, rc==SQLITE_OK ? Tcl_DStringValue(&str) : zErr);
   224    224     Tcl_DStringFree(&str);
   225         -  if( zErr ) free(zErr);
          225  +  if( zErr ) sqlite3_free(zErr);
   226    226     if( sqlite3TestErrCode(interp, db, rc) ) return TCL_ERROR;
   227    227     return TCL_OK;
   228    228   }
   229    229   
   230    230   /*
   231    231   ** Usage:  sqlite3_mprintf_z_test  SEPARATOR  ARG0  ARG1 ...
   232    232   **
................................................................................
   313    313       for(i=0; i<(nRow+1)*nCol; i++){
   314    314         Tcl_AppendElement(interp, aResult[i] ? aResult[i] : "NULL");
   315    315       }
   316    316     }else{
   317    317       Tcl_AppendElement(interp, zErr);
   318    318     }
   319    319     sqlite3_free_table(aResult);
   320         -  if( zErr ) free(zErr);
          320  +  if( zErr ) sqlite3_free(zErr);
   321    321     if( sqlite3TestErrCode(interp, db, rc) ) return TCL_ERROR;
   322    322     return TCL_OK;
   323    323   }
   324    324   
   325    325   
   326    326   /*
   327    327   ** Usage:  sqlite3_last_insert_rowid DB