Fix a couple of fairly obscure cases where an assert() could fail following a malloc failure. (CVS 6360)
FossilOrigin-Name: cc0d925669ddeb55048e88aa5b4f658be60b0962
diff --git a/src/vdbeblob.c b/src/vdbeblob.c
index a7caf24..8284467 100644
--- a/src/vdbeblob.c
+++ b/src/vdbeblob.c
@@ -12,7 +12,7 @@
**
** This file contains code used to implement incremental BLOB I/O.
**
-** $Id: vdbeblob.c,v 1.29 2009/03/05 03:48:07 shane Exp $
+** $Id: vdbeblob.c,v 1.30 2009/03/19 18:51:07 danielk1977 Exp $
*/
#include "sqliteInt.h"
@@ -248,8 +248,8 @@
blob_open_out:
zErr[sizeof(zErr)-1] = '\0';
- if( rc!=SQLITE_OK || db->mallocFailed ){
- sqlite3_finalize((sqlite3_stmt *)v);
+ if( v && (rc!=SQLITE_OK || db->mallocFailed) ){
+ sqlite3VdbeFinalize(v);
}
sqlite3Error(db, rc, (rc==SQLITE_OK?0:zErr));
rc = sqlite3ApiExit(db, rc);