Added missing channel entry unreferencing calls.
authorPekka Riikonen <priikone@silcnet.org>
Tue, 13 Nov 2007 16:36:05 +0000 (16:36 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Tue, 13 Nov 2007 16:36:05 +0000 (16:36 +0000)
CHANGES
lib/silcclient/client_register.c
lib/silcclient/command_reply.c

diff --git a/CHANGES b/CHANGES
index dc2339dee92ecd05169fcd166bf486c37364b0ed..55db593ec7ccc6bc1d925f2eb5364bb70976d7eb 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,9 @@
+Tue Nov 13 18:24:56 EET 2007 Pekka Riikonen <priikone@silcnet.org>
+
+       * Added missing channel unreferencing in CMODE, CUMODE,
+         TOPIC, INVITE, BAN and KICK command replies.  Affected
+         file is lib/silcclient/command_reply.c.
+
 Sun Nov 11 23:04:54 EET 2007 Pekka Riikonen <priikone@silcnet.org>
 
        * Free stream data and abort ongoing protocols correctly
index 9bf29987c7a0332ffa724633527d771c151d469b..91b135a488edb0bce240750e2ea71c4a5fa36817 100644 (file)
@@ -425,6 +425,8 @@ SILC_FSM_STATE(silc_client_st_resume_resolve_channels)
     channel = silc_client_get_channel_by_id(client, conn, &channel_id);
     if (!channel)
       silc_client_add_channel(client, conn, name, 0, &channel_id);
+    else
+      silc_client_unref_channel(client, conn, channel);
 
     res_argv = silc_realloc(res_argv, sizeof(*res_argv) * (res_argc + 1));
     res_argv_lens = silc_realloc(res_argv_lens, sizeof(*res_argv_lens) *
index a487cb95084bf8bcfe4eae239d2f1ada8b9a7ca3..a4f34ffdb7f8aed92d7d0f32372bd541595a2039 100644 (file)
@@ -822,7 +822,7 @@ SILC_FSM_STATE(silc_client_command_reply_topic)
   SilcClient client = conn->client;
   SilcCommandPayload payload = state_context;
   SilcArgumentPayload args = silc_command_get_args(payload);
-  SilcChannelEntry channel;
+  SilcChannelEntry channel = NULL;
   char *topic;
   SilcUInt32 len;
   SilcID id;
@@ -859,6 +859,7 @@ SILC_FSM_STATE(silc_client_command_reply_topic)
   silc_client_command_callback(cmd, channel, channel->topic);
 
  out:
+  silc_client_unref_channel(client, conn, channel);
   silc_fsm_next(fsm, silc_client_command_reply_processed);
   return SILC_FSM_CONTINUE;
 }
@@ -874,7 +875,7 @@ SILC_FSM_STATE(silc_client_command_reply_invite)
   SilcClient client = conn->client;
   SilcCommandPayload payload = state_context;
   SilcArgumentPayload args = silc_command_get_args(payload);
-  SilcChannelEntry channel;
+  SilcChannelEntry channel = NULL;
   unsigned char *tmp;
   SilcUInt32 len;
   SilcArgumentPayload invite_args = NULL;
@@ -909,6 +910,7 @@ SILC_FSM_STATE(silc_client_command_reply_invite)
     silc_argument_payload_free(invite_args);
 
  out:
+  silc_client_unref_channel(client, conn, channel);
   silc_fsm_next(fsm, silc_client_command_reply_processed);
   return SILC_FSM_CONTINUE;
 }
@@ -1420,7 +1422,7 @@ SILC_FSM_STATE(silc_client_command_reply_cmode)
   SilcArgumentPayload args = silc_command_get_args(payload);
   unsigned char *tmp;
   SilcUInt32 mode;
-  SilcChannelEntry channel;
+  SilcChannelEntry channel = NULL;
   SilcUInt32 len;
   SilcPublicKey public_key = NULL;
   SilcID id;
@@ -1481,6 +1483,7 @@ SILC_FSM_STATE(silc_client_command_reply_cmode)
                               channel->channel_pubkeys, channel->user_limit);
 
  out:
+  silc_client_unref_channel(client, conn, channel);
   if (public_key)
     silc_pkcs_public_key_free(public_key);
   silc_fsm_next(fsm, silc_client_command_reply_processed);
@@ -1499,7 +1502,7 @@ SILC_FSM_STATE(silc_client_command_reply_cumode)
   SilcCommandPayload payload = state_context;
   SilcArgumentPayload args = silc_command_get_args(payload);
   SilcClientEntry client_entry;
-  SilcChannelEntry channel;
+  SilcChannelEntry channel = NULL;
   SilcChannelUser chu;
   unsigned char *modev;
   SilcUInt32 len, mode;
@@ -1556,6 +1559,7 @@ SILC_FSM_STATE(silc_client_command_reply_cumode)
   silc_client_unref_client(client, conn, client_entry);
 
  out:
+  silc_client_unref_channel(client, conn, channel);
   silc_fsm_next(fsm, silc_client_command_reply_processed);
   return SILC_FSM_CONTINUE;
 }
@@ -1570,7 +1574,7 @@ SILC_FSM_STATE(silc_client_command_reply_kick)
   SilcCommandPayload payload = state_context;
   SilcArgumentPayload args = silc_command_get_args(payload);
   SilcClientEntry client_entry;
-  SilcChannelEntry channel;
+  SilcChannelEntry channel = NULL;
   SilcID id;
 
   /* Sanity checks */
@@ -1609,6 +1613,7 @@ SILC_FSM_STATE(silc_client_command_reply_kick)
   silc_client_unref_client(client, conn, client_entry);
 
  out:
+  silc_client_unref_channel(client, conn, channel);
   silc_fsm_next(fsm, silc_client_command_reply_processed);
   return SILC_FSM_CONTINUE;
 }
@@ -1716,7 +1721,7 @@ SILC_FSM_STATE(silc_client_command_reply_ban)
   SilcClient client = conn->client;
   SilcCommandPayload payload = state_context;
   SilcArgumentPayload args = silc_command_get_args(payload);
-  SilcChannelEntry channel;
+  SilcChannelEntry channel = NULL;
   unsigned char *tmp;
   SilcUInt32 len;
   SilcArgumentPayload invite_args = NULL;
@@ -1751,6 +1756,7 @@ SILC_FSM_STATE(silc_client_command_reply_ban)
     silc_argument_payload_free(invite_args);
 
  out:
+  silc_client_unref_channel(client, conn, channel);
   silc_fsm_next(fsm, silc_client_command_reply_processed);
   return SILC_FSM_CONTINUE;
 }