From e396906fee5758aaf814afb2042eccc5327ca698 Mon Sep 17 00:00:00 2001 From: Julien BLACHE Date: Sat, 17 Jul 2010 12:48:11 +0200 Subject: [PATCH] Protect db_perthread_deinit() against NULL hdl --- src/db.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/db.c b/src/db.c index 9f26fc78..1cb710a8 100644 --- a/src/db.c +++ b/src/db.c @@ -3613,6 +3613,9 @@ db_perthread_deinit(void) { sqlite3_stmt *stmt; + if (!hdl) + return; + /* Tear down anything that's in flight */ while ((stmt = sqlite3_next_stmt(hdl, 0))) sqlite3_finalize(stmt);