diff options
author | Haru <haru@dotalux.com> | 2018-03-09 01:04:29 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-09 01:04:29 +0100 |
commit | b2b4f1b26e5965b09d53ac55040ef1517a81bae0 (patch) | |
tree | b4563d4cfc8e9438913ea2cfd35bcb3ecd0d57d1 /src/map/atcommand.c | |
parent | ea964c75ac213eab98e22cce938d8bf141071179 (diff) | |
parent | 2d502ef94e09e5057f2868288d9054f8f0f39348 (diff) | |
download | hercules-b2b4f1b26e5965b09d53ac55040ef1517a81bae0.tar.gz hercules-b2b4f1b26e5965b09d53ac55040ef1517a81bae0.tar.bz2 hercules-b2b4f1b26e5965b09d53ac55040ef1517a81bae0.tar.xz hercules-b2b4f1b26e5965b09d53ac55040ef1517a81bae0.zip |
Merge pull request #1979 from 4144/fixlogin
fix different crashes
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r-- | src/map/atcommand.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 2bcb22738..b0ad24c11 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -10056,6 +10056,7 @@ bool atcommand_exec(const int fd, struct map_session_data *sd, const char *messa { char params[100], command[100]; char output[CHAT_SIZE_MAX]; + bool logCommand; // Reconstructed message char atcmd_msg[CHAT_SIZE_MAX]; @@ -10199,6 +10200,7 @@ bool atcommand_exec(const int fd, struct map_session_data *sd, const char *messa } } + logCommand = info->log; //Attempt to use the command if ((info->func(fd, ssd, command, params,info) != true)) { #ifdef AUTOTRADE_PERSISTENCY @@ -10210,7 +10212,8 @@ bool atcommand_exec(const int fd, struct map_session_data *sd, const char *messa return true; } - if (info->log) /* log only if this command should be logged [Ind/Hercules] */ + // info->log cant be used here, because info can be freed [4144] + if (logCommand) /* log only if this command should be logged [Ind/Hercules] */ logs->atcommand(sd, is_atcommand ? atcmd_msg : message); return true; |