From: Timo Sirainen Date: Mon, 23 Aug 2010 14:59:22 +0000 (+0100) Subject: auth: Abort any pending SQL requests earler to avoid crashes. X-Git-Tag: 2.0.1~10 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=607f0cc7310ae7ecde7c96f67945026a128d8174;p=thirdparty%2Fdovecot%2Fcore.git auth: Abort any pending SQL requests earler to avoid crashes. --- diff --git a/src/auth/db-sql.c b/src/auth/db-sql.c index 1367d15e7f..9dc3ecd017 100644 --- a/src/auth/db-sql.c +++ b/src/auth/db-sql.c @@ -112,6 +112,10 @@ void db_sql_unref(struct sql_connection **_conn) { struct sql_connection *conn = *_conn; + /* abort all pending auth requests before setting conn to NULL, + so that callbacks can still access it */ + sql_disconnect(conn->db); + *_conn = NULL; if (--conn->refcount > 0) return;