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:
@@ -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 ){
|
||||
|
||||
Reference in New Issue
Block a user