Protect db_perthread_deinit() against NULL hdl

This commit is contained in:
Julien BLACHE 2010-07-17 12:48:11 +02:00
parent a678f5c99b
commit e396906fee

View File

@ -3613,6 +3613,9 @@ db_perthread_deinit(void)
{ {
sqlite3_stmt *stmt; sqlite3_stmt *stmt;
if (!hdl)
return;
/* Tear down anything that's in flight */ /* Tear down anything that's in flight */
while ((stmt = sqlite3_next_stmt(hdl, 0))) while ((stmt = sqlite3_next_stmt(hdl, 0)))
sqlite3_finalize(stmt); sqlite3_finalize(stmt);