- Besseres Logging, wenn malloc() fehl schlaegt.

- Ban- und Invite-Lists werden korrekt aufgeraeumt.
This commit is contained in:
Alexander Barton 2002-06-09 13:15:58 +00:00
parent acd91c0164
commit 1fd7215def
1 changed files with 7 additions and 3 deletions

View File

@ -9,7 +9,7 @@
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste * Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS. * der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
* *
* $Id: channel.c,v 1.27 2002/06/02 17:13:07 alex Exp $ * $Id: channel.c,v 1.28 2002/06/09 13:15:58 alex Exp $
* *
* channel.c: Management der Channels * channel.c: Management der Channels
*/ */
@ -36,6 +36,7 @@
#include "resolve.h" #include "resolve.h"
#include "conf.h" #include "conf.h"
#include "hash.h" #include "hash.h"
#include "lists.h"
#include "log.h" #include "log.h"
#include "messages.h" #include "messages.h"
@ -616,7 +617,7 @@ New_Chan( CHAR *Name )
c = malloc( sizeof( CHANNEL )); c = malloc( sizeof( CHANNEL ));
if( ! c ) if( ! c )
{ {
Log( LOG_EMERG, "Can't allocate memory!" ); Log( LOG_EMERG, "Can't allocate memory! [New_Chan]" );
return NULL; return NULL;
} }
c->next = NULL; c->next = NULL;
@ -662,7 +663,7 @@ Add_Client( CHANNEL *Chan, CLIENT *Client )
cl2chan = malloc( sizeof( CL2CHAN )); cl2chan = malloc( sizeof( CL2CHAN ));
if( ! cl2chan ) if( ! cl2chan )
{ {
Log( LOG_EMERG, "Can't allocate memory!" ); Log( LOG_EMERG, "Can't allocate memory! [Add_Client]" );
return NULL; return NULL;
} }
cl2chan->channel = Chan; cl2chan->channel = Chan;
@ -787,6 +788,9 @@ Delete_Channel( CHANNEL *Chan )
Log( LOG_DEBUG, "Freed channel structure for \"%s\".", Chan->name ); Log( LOG_DEBUG, "Freed channel structure for \"%s\".", Chan->name );
/* Invite- und Ban-Lists aufraeumen */
Lists_DeleteChannel( chan );
/* Neu verketten und freigeben */ /* Neu verketten und freigeben */
if( last_chan ) last_chan->next = chan->next; if( last_chan ) last_chan->next = chan->next;
else My_Channels = chan->next; else My_Channels = chan->next;