summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2018-02-21 00:58:31 +0300
committerAndrei Karas <akaras@inbox.ru>2018-02-21 01:14:08 +0300
commitd1be48e253106e4efaf9db40fce0609cede4f778 (patch)
tree5742975221dc18bc0edb16efd89752316c83d55c
parent000382738765bb2f96a92161c76ad14e3e58c61e (diff)
downloadhercules-d1be48e253106e4efaf9db40fce0609cede4f778.tar.gz
hercules-d1be48e253106e4efaf9db40fce0609cede4f778.tar.bz2
hercules-d1be48e253106e4efaf9db40fce0609cede4f778.tar.xz
hercules-d1be48e253106e4efaf9db40fce0609cede4f778.zip
fix null pointer in login.c in login->accounts.
This affect only plugins.
-rw-r--r--src/login/login.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/login/login.c b/src/login/login.c
index 5b281c22d..9fe9de0d3 100644
--- a/src/login/login.c
+++ b/src/login/login.c
@@ -1985,7 +1985,8 @@ int do_final(void)
login->dbs->account_engine->db->destroy(login->dbs->account_engine->db);
login->dbs->account_engine->db = NULL;
}
- accounts = NULL; // destroyed in account_engine
+ login->accounts = NULL; // destroyed in account_engine
+ accounts = NULL;
login->online_db->destroy(login->online_db, NULL);
login->auth_db->destroy(login->auth_db, NULL);
@@ -2101,6 +2102,7 @@ int do_init(int argc, char** argv)
login->dbs->account_engine->constructor = account->db_sql;
login->dbs->account_engine->db = login->dbs->account_engine->constructor();
accounts = login->dbs->account_engine->db;
+ login->accounts = accounts;
if( accounts == NULL ) {
ShowFatalError("do_init: account engine 'sql' not found.\n");
exit(EXIT_FAILURE);