]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
auth: Unload modules earlier to avoid crashes.
authorTimo Sirainen <tss@iki.fi>
Tue, 17 Nov 2009 23:53:09 +0000 (18:53 -0500)
committerTimo Sirainen <tss@iki.fi>
Tue, 17 Nov 2009 23:53:09 +0000 (18:53 -0500)
--HG--
branch : HEAD

src/auth/main.c

index 1e1989d8cf65f3dd35d5dd9d9ee967847c15ba58..a73141c1879792336ecd473b19dd40e79ca8abdd 100644 (file)
@@ -97,16 +97,19 @@ static void main_deinit(void)
        auth_master_connections_deinit();
         auth_worker_server_deinit();
 
-       userdbs_deinit();
-       passdbs_deinit();
        mech_deinit(auth->set);
        auth_deinit(&auth);
 
+       /* allow modules to unregister their dbs/drivers/etc. before freeing
+          the whole data structures containing them. */
+       module_dir_unload(&modules);
+
+       userdbs_deinit();
+       passdbs_deinit();
         password_schemes_deinit();
        sql_drivers_deinit();
        random_deinit();
 
-       module_dir_unload(&modules);
        array_free(&listen_fd_types);
 }