diff options
author | shennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-02-17 16:56:02 +0000 |
---|---|---|
committer | shennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-02-17 16:56:02 +0000 |
commit | eb54661901e395d01995364f9c63b67be68f3bc7 (patch) | |
tree | b89397abfcfb4ca7984695d5834df871a07edd2d /src | |
parent | 56529fcd66b82d9fa23aed77e7c92f07eb290a8c (diff) | |
download | hercules-eb54661901e395d01995364f9c63b67be68f3bc7.tar.gz hercules-eb54661901e395d01995364f9c63b67be68f3bc7.tar.bz2 hercules-eb54661901e395d01995364f9c63b67be68f3bc7.tar.xz hercules-eb54661901e395d01995364f9c63b67be68f3bc7.zip |
Fixed chrif_authreq possible crash, bugreport:5337
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15595 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r-- | src/map/chrif.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/map/chrif.c b/src/map/chrif.c index 5d060a16f..4c70aff90 100644 --- a/src/map/chrif.c +++ b/src/map/chrif.c @@ -275,8 +275,7 @@ int chrif_save(struct map_session_data *sd, int flag) ShowError("chrif_save: Failed to set up player %d:%d for proper quitting!\n", sd->status.account_id, sd->status.char_id); } - if(!chrif_isconnected()) - return -1; //Character is saved on reconnect. + chrif_check(-1); //Character is saved on reconnect. //For data sync if (sd->state.storage_flag == 2) @@ -552,8 +551,7 @@ void chrif_authreq(struct map_session_data *sd) { struct auth_node *node= chrif_search(sd->bl.id); - if( node != NULL ) - { + if( node != NULL || !chrif_isconnected() ) { set_eof(sd->fd); return; } @@ -692,9 +690,8 @@ int auth_db_cleanup_sub(DBKey key,void *data,va_list ap) return 0; } -int auth_db_cleanup(int tid, unsigned int tick, int id, intptr_t data) -{ - if(!chrif_isconnected()) return 0; +int auth_db_cleanup(int tid, unsigned int tick, int id, intptr_t data) { + chrif_check(0); auth_db->foreach(auth_db, auth_db_cleanup_sub); return 0; } |