mem leak
authorMatthias Wachs <wachs@net.in.tum.de>
Tue, 27 Sep 2011 11:15:59 +0000 (11:15 +0000)
committerMatthias Wachs <wachs@net.in.tum.de>
Tue, 27 Sep 2011 11:15:59 +0000 (11:15 +0000)
src/transport/plugin_transport_http_client.c
src/transport/plugin_transport_http_new.c

index bc2051eef16a1d9fb9901d5eb6b1a213019aeea5..89acb4641ccac3208f3925ddf536653cc3d6a5b0 100644 (file)
@@ -205,8 +205,6 @@ client_run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 #endif
          client_disconnect(s);
          //GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, plugin->name,"Notifying about ended session to peer `%s' `%s'\n", GNUNET_i2s (&s->target), http_plugin_address_to_string (plugin, s->addr, s->addrlen));
-         if (s->msg_tk != NULL)
-           GNUNET_SERVER_mst_destroy (s->msg_tk);
          notify_session_end (plugin, &s->target, s);
        }
     }
index 66f79b3c4f318267d09feb229eac0ad5deb5a08f..ca55d1d1d02764588d13f8844fc61c022f3c7c36 100644 (file)
@@ -398,6 +398,11 @@ lookup_session (struct Plugin *plugin, const struct GNUNET_PeerIdentity *target,
 void
 delete_session (struct Session *s)
 {
+  if (s->msg_tk != NULL)
+  {
+    GNUNET_SERVER_mst_destroy (s->msg_tk);
+    s->msg_tk = NULL;
+  }
   GNUNET_free (s->addr);
   GNUNET_free_non_null(s->server_recv);
   GNUNET_free_non_null(s->server_send);