Hi

I am having code like this:

  rc = sqlite3_prepare(db, zSql, -1, &pStmt, 0);
  if( rc!=SQLITE_OK ){
    return rc;
  }
  sqlite3_bind_text(pStmt, 1, zKey, -1, SQLITE_STATIC);
  sqlite3_bind_blob(pStmt, 2, zBlob, nBlob, SQLITE_STATIC);

  while( sqlite3_step(pStmt)==SQLITE_ROW )
{
    *pnBlob = sqlite3_column_bytes(pStmt, 0);
    *pzBlob = (unsigned char *)malloc(*pnBlob);
    memcpy(*pzBlob, sqlite3_column_blob(pStmt, 0), *pnBlob);
  }

 sqlite3_finalize(pStmt);

My question here is do I need to do sqlite3_finalize(pStmt); after
every sqlite3_step() to free all memory allocated by
sqlite3_step().Does calling finalize at end will free all memory
allocated by all steps statements?

Example shown http://www.sqlite.org/cvstrac/wiki?p=BlobExample does
same , it calls finalize after  every step.

My Program shows some Memory Leaks(Virtual Bytes).

Please clarify.

Anand

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to