1
0
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:
danielk1977
2006-06-23 11:34:54 +00:00
parent be71889703
commit b7a2f2e8b7
7 changed files with 37 additions and 22 deletions

View File

@@ -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);