]> arthur.barton.de Git - ngircd.git/blobdiff - src/ngircd/channel.c
Free topic array on channel deletion.
[ngircd.git] / src / ngircd / channel.c
index a4eca1f18425f0b79a05ef225f129544b1f1f75d..44133e49a3865627a6f8e4ea843d530b3cda842f 100644 (file)
@@ -218,11 +218,16 @@ Channel_Part(CLIENT * Client, CLIENT * Origin, const char *Name, const char *Rea
        assert(Reason != NULL);
 
        chan = Channel_Search(Name);
-       if ((!chan) || (!Get_Cl2Chan(chan, Client))) {
+       if (!chan) {
                IRC_WriteStrClient(Client, ERR_NOSUCHCHANNEL_MSG,
                                   Client_ID(Client), Name);
                return false;
        }
+       if (!Get_Cl2Chan(chan, Client)) {
+               IRC_WriteStrClient(Client, ERR_NOTONCHANNEL_MSG,
+                                  Client_ID(Client), Name);
+               return false;
+       }
 
        if (!Remove_Client(REMOVE_PART, chan, Client, Origin, Reason, true))
                return false;
@@ -1022,9 +1027,9 @@ Delete_Channel( CHANNEL *Chan )
 
        Log( LOG_DEBUG, "Freed channel structure for \"%s\".", Chan->name );
 
-       /* Invite- und Ban-Lists aufraeumen */
-       Lists_Free( &chan->list_bans );
-       Lists_Free( &chan->list_invites );
+       array_free(&chan->topic);
+       Lists_Free(&chan->list_bans);
+       Lists_Free(&chan->list_invites);
 
        /* Neu verketten und freigeben */
        if( last_chan ) last_chan->next = chan->next;