From: pk910 Date: Tue, 31 Jan 2012 18:53:27 +0000 (+0100) Subject: fixed crash if the user quits directly after performing a command & moved mysql_free... X-Git-Tag: v5.3~31 X-Git-Url: http://git.pk910.de/?p=NeonServV5.git;a=commitdiff_plain;h=9ec0d46248903ba3f53de3d9ef3dceb2d2f1970f fixed crash if the user quits directly after performing a command & moved mysql_free() into main loop --- diff --git a/src/IRCEvents.c b/src/IRCEvents.c index cc59f74..eb29a09 100644 --- a/src/IRCEvents.c +++ b/src/IRCEvents.c @@ -124,7 +124,7 @@ void pre_event(UNUSED_ARG(int type)) { } void post_event(UNUSED_ARG(int type)) { - mysql_free(); + } //EVENTS diff --git a/src/main.c b/src/main.c index 1730e38..6486d6c 100644 --- a/src/main.c +++ b/src/main.c @@ -116,6 +116,7 @@ void * thread_main(void *arg) { } while(time(0) < socket_wait); clearTempUsers(); destroyEvents(); + mysql_free(); } running_threads--; return NULL; @@ -284,6 +285,7 @@ main: loop_bots(); qserver_loop(); queue_loop(); + mysql_free(); usleep(usleep_delay); } for(tid_id = 0; tid_id < worker_threads; tid_id++) { @@ -303,6 +305,7 @@ main: destroyEvents(); qserver_loop(); queue_loop(); + mysql_free(); } #endif cleanup(); diff --git a/src/modcmd.c b/src/modcmd.c index 5ece7b0..8846d90 100644 --- a/src/modcmd.c +++ b/src/modcmd.c @@ -128,7 +128,8 @@ static void handle_command_async(struct ClientSocket *client, struct UserNode *u static USERAUTH_CALLBACK(command_checked_auth) { struct command_check_user_cache *cache = data; tmp_text_client = cache->textclient; - handle_command_async(cache->client, user, cache->chan, cache->sent_chan, cache->cbind, cache->argv, cache->argc); + if(user) + handle_command_async(cache->client, user, cache->chan, cache->sent_chan, cache->cbind, cache->argv, cache->argc); free(cache->message); if(cache->args_buffer) free(cache->args_buffer);