]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
auth: Abort any pending SQL requests earler to avoid crashes.
authorTimo Sirainen <tss@iki.fi>
Mon, 23 Aug 2010 14:59:22 +0000 (15:59 +0100)
committerTimo Sirainen <tss@iki.fi>
Mon, 23 Aug 2010 14:59:22 +0000 (15:59 +0100)
src/auth/db-sql.c

index 1367d15e7faabf0488262f8882837cd8a678f11f..9dc3ecd0179e34aba855cc067f0b43df91b87a0b 100644 (file)
@@ -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;