X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=src%2Fmodules%2FNeonServ.mod%2Fevent_neonserv_join.c;h=5f77f4259d13db411edf02171f7581243916e61d;hb=139ae91def764e66b5d2024723700101cc2a379e;hp=ba12f166e74e4679f40e738d096e4496972fbd95;hpb=7289d420ddc81d9975ed6d55dfdfd70dff2b2d48;p=NeonServV5.git diff --git a/src/modules/NeonServ.mod/event_neonserv_join.c b/src/modules/NeonServ.mod/event_neonserv_join.c index ba12f16..5f77f42 100644 --- a/src/modules/NeonServ.mod/event_neonserv_join.c +++ b/src/modules/NeonServ.mod/event_neonserv_join.c @@ -53,7 +53,7 @@ static void neonserv_event_join(struct ChanUser *chanuser) { if(!(user->flags & USERFLAG_ISAUTHED)) { struct neonserv_event_join_cache *cache = malloc(sizeof(*cache)); if (!cache) { - perror("malloc() failed"); + printf_log("neonserv", LOG_ERROR, "%s:%d malloc() failed", __FILE__, __LINE__); return; } cache->client = client; @@ -76,7 +76,7 @@ static void neonserv_event_join_async1(struct ClientSocket *client, struct ChanU struct UserNode *user = chanuser->user; struct ModeBuffer *modeBuf; int with_halfops = get_int_field("General.have_halfop"); - MYSQL_RES *res; + MYSQL_RES *res, *res2; MYSQL_ROW row, chanuserrow, defaultrow = NULL; printf_mysql_query("SELECT `channel_maxusers`, `channel_greeting`, `channel_usergreeting`, `channel_getop`, `channel_getvoice`, `channel_userinfo`, `channel_dynlimit`, `channel_gethalfop` FROM `channels` WHERE `channel_id` = '%d'", chan->channel_id); res = mysql_use(); @@ -219,8 +219,8 @@ static void neonserv_event_join_async1(struct ClientSocket *client, struct ChanU } if(chanuserrow[3] == NULL && defaultrow == NULL) { printf_mysql_query("SELECT `channel_getinvite` FROM `channels` WHERE `channel_name` = 'defaults'"); - res = mysql_use(); - defaultrow = mysql_fetch_row(res); + res2 = mysql_use(); + defaultrow = mysql_fetch_row(res2); } getinvite = atoi((chanuserrow[3] ? chanuserrow[3] : defaultrow[0])); if(atoi(chanuserrow[0]) >= getinvite) {