-avoid use after free
authorChristian Grothoff <christian@grothoff.org>
Sat, 16 Nov 2013 18:19:22 +0000 (18:19 +0000)
committerChristian Grothoff <christian@grothoff.org>
Sat, 16 Nov 2013 18:19:22 +0000 (18:19 +0000)
src/conversation/gnunet-service-conversation.c

index 36e8d5060f173dae7f47b0f107a80bdf8b068b1a..900de3275b299a70dd06b957851e44542ad52f1f 100644 (file)
@@ -968,6 +968,7 @@ handle_mesh_hangup_message (void *cls,
   struct Channel *ch = *channel_ctx;
   struct Line *line;
   struct ClientPhoneHangupMessage hup;
+  enum ChannelStatus status;
 
   if (NULL == ch)
   {
@@ -980,8 +981,9 @@ handle_mesh_hangup_message (void *cls,
   hup.header.size = sizeof (hup);
   hup.header.type = htons (GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_HANG_UP);
   hup.cid = ch->cid;
+  status = ch->status;
   destroy_line_mesh_channels (ch);
-  switch (ch->status)
+  switch (status)
   {
   case CS_CALLEE_RINGING:
   case CS_CALLEE_CONNECTED: