fixed crash bug in cmd_NeonServ.mod/cmd_neonserv_set.c
[NeonServV5.git] / src / modules / NeonServ.mod / event_neonserv_notice.c
index 84fb51a25084da0394b3c8fc608b3d253f4cf213..c15089a4ed3d6ce72a1a161c229202c8324239ad 100644 (file)
@@ -1,4 +1,4 @@
-/* event_neonserv_notice.c - NeonServ v5.3
+/* event_neonserv_notice.c - NeonServ v5.6
  * Copyright (C) 2011-2012  Philipp Kreil (pk910)
  * 
  * This program is free software: you can redistribute it and/or modify
@@ -34,14 +34,14 @@ static void neonserv_event_channotice(struct UserNode *user, struct ChanNode *ch
     if(!(user->flags & USERFLAG_ISAUTHED)) {
         struct neonserv_event_notice_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;
         cache->user = user;
         cache->chan = chan;
         cache->message = strdup(message);
-        get_userauth(user, neonserv_event_notice_nick_lookup, cache);
+        get_userauth(user, module_id, neonserv_event_notice_nick_lookup, cache);
     } else
         neonserv_event_notice_async1(client, user, chan, message);
 }
@@ -93,7 +93,7 @@ static void neonserv_event_notice_async1(struct ClientSocket *client, struct Use
                 char banidBuf[20];
                 sprintf(nameBuf, "ban_%d", banid);
                 sprintf(banidBuf, "%d", banid);
-                timeq_add_name(nameBuf, duration, channel_ban_timeout, strdup(banidBuf));
+                timeq_add_name(nameBuf, duration, module_id, channel_ban_timeout, strdup(banidBuf));
             case 1: //KICKBAN
                 if(!banmask)
                     banmask = generate_banmask(user, banmaskBuf);