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

Fix an assert or memory leak that occurs when trying to EXPLAIN a statement

other than a SELECT that outputs results.  Examples of such statements
include PRAGMA integrity_check or INSERT/DELETE/UPDATE with PRAGMA
count_changes=ON. (CVS 2743)

FossilOrigin-Name: 533a85eee2370aafe204ff3eed50eb7fc0149e83
This commit is contained in:
drh
2005-10-05 11:35:09 +00:00
parent 29bc461550
commit cc43cabcb0
5 changed files with 24 additions and 14 deletions

View File

@@ -857,9 +857,10 @@ static void Cleanup(Vdbe *p){
void sqlite3VdbeSetNumCols(Vdbe *p, int nResColumn){
Mem *pColName;
int n;
assert( 0==p->nResColumn );
p->nResColumn = nResColumn;
releaseMemArray(p->aColName, p->nResColumn*2);
sqliteFree(p->aColName);
n = nResColumn*2;
p->nResColumn = nResColumn;
p->aColName = pColName = (Mem*)sqliteMalloc( sizeof(Mem)*n );
if( p->aColName==0 ) return;
while( n-- > 0 ){