aboutsummaryrefslogtreecommitdiff
path: root/src/messenger/gnunet-service-messenger_tunnel.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/messenger/gnunet-service-messenger_tunnel.c')
-rw-r--r--src/messenger/gnunet-service-messenger_tunnel.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/messenger/gnunet-service-messenger_tunnel.c b/src/messenger/gnunet-service-messenger_tunnel.c
index fdd6429e6..c21f298b3 100644
--- a/src/messenger/gnunet-service-messenger_tunnel.c
+++ b/src/messenger/gnunet-service-messenger_tunnel.c
@@ -176,6 +176,9 @@ handle_tunnel_message (void *cls, const struct GNUNET_MessageHeader *header)
176{ 176{
177 struct GNUNET_MESSENGER_SrvTunnel *tunnel = cls; 177 struct GNUNET_MESSENGER_SrvTunnel *tunnel = cls;
178 178
179 if (!tunnel)
180 return;
181
179 const uint16_t length = ntohs (header->size) - sizeof(*header); 182 const uint16_t length = ntohs (header->size) - sizeof(*header);
180 const char *buffer = (const char*) &header[1]; 183 const char *buffer = (const char*) &header[1];
181 184
@@ -190,9 +193,6 @@ handle_tunnel_message (void *cls, const struct GNUNET_MessageHeader *header)
190 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Got message of kind: %s!\n", 193 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, "Got message of kind: %s!\n",
191 GNUNET_MESSENGER_name_of_kind(message.header.kind)); 194 GNUNET_MESSENGER_name_of_kind(message.header.kind));
192 195
193 if (!tunnel)
194 return;
195
196 const int new_message = update_room_message ( 196 const int new_message = update_room_message (
197 tunnel->room, copy_message (&message), &hash 197 tunnel->room, copy_message (&message), &hash
198 ); 198 );
@@ -226,6 +226,8 @@ handle_tunnel_message (void *cls, const struct GNUNET_MessageHeader *header)
226 } 226 }
227 227
228receive_done: 228receive_done:
229 cleanup_message(&message);
230
229 GNUNET_CADET_receive_done (tunnel->channel); 231 GNUNET_CADET_receive_done (tunnel->channel);
230} 232}
231 233