diff options
author | drh <drh@noemail.net> | 2005-10-05 11:35:09 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2005-10-05 11:35:09 +0000 |
commit | cc43cabcb052951261b439d340afd6b6721aafa1 (patch) | |
tree | 2496789b5e9c96d412bccead5fe63b7292303039 /src | |
parent | 29bc461550a03419dc8a8be10d62eee4d8ea3c97 (diff) | |
download | sqlite-cc43cabcb052951261b439d340afd6b6721aafa1.tar.gz sqlite-cc43cabcb052951261b439d340afd6b6721aafa1.zip |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/vdbeaux.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/vdbeaux.c b/src/vdbeaux.c index cba9c096d..26f829f07 100644 --- a/src/vdbeaux.c +++ b/src/vdbeaux.c @@ -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 ){ |