mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-14 00:22:38 +03:00
Fix some memory leaks that occur when malloc() fails. (CVS 3286)
FossilOrigin-Name: b56cc035f2be5c1a3f63efbb4c181e405a140fbb
This commit is contained in:
@@ -875,8 +875,8 @@ static void closeAllCursors(Vdbe *p){
|
||||
for(i=0; i<p->nCursor; i++){
|
||||
if( !p->inVtabMethod || (p->apCsr[i] && !p->apCsr[i]->pVtabCursor) ){
|
||||
sqlite3VdbeFreeCursor(p, p->apCsr[i]);
|
||||
p->apCsr[i] = 0;
|
||||
}
|
||||
p->apCsr[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1250,6 +1250,9 @@ int sqlite3VdbeHalt(Vdbe *p){
|
||||
if( p->magic!=VDBE_MAGIC_RUN ){
|
||||
/* Already halted. Nothing to do. */
|
||||
assert( p->magic==VDBE_MAGIC_HALT );
|
||||
#ifndef SQLITE_OMIT_VIRTUALTABLE
|
||||
closeAllCursors(p);
|
||||
#endif
|
||||
return SQLITE_OK;
|
||||
}
|
||||
closeAllCursors(p);
|
||||
|
||||
Reference in New Issue
Block a user