leak
[oweals/gnunet.git] / src / datastore / gnunet-service-datastore.c
index 87ae427e4cb1704f8020d66a50c6520868640492..f80abef0653c54319135d371220cc06a14ebbde8 100644 (file)
@@ -456,6 +456,8 @@ transmit_callback (void *cls,
  *
  * @param client target of the message
  * @param msg message to transmit, will be freed!
+ * @param tc function to call afterwards
+ * @param tc_cls closure for tc
  * @param end is this the last response (and we should
  *        signal the server completion accodingly after
  *        transmitting this message)?
@@ -537,7 +539,7 @@ transmit_status (struct GNUNET_SERVER_Client *client,
  * Function called once the transmit operation has
  * either failed or succeeded.
  *
- * @param cls closure
+ * @param next_cls closure for calling "next_request" callback
  * @param status GNUNET_OK on success, GNUNET_SYSERR on error
  */
 static void 
@@ -748,7 +750,6 @@ handle_release_reserve (void *cls,
          return;
        }       
       prev = pos;
-      pos = next;
     }
   GNUNET_break (0);
   transmit_status (client, GNUNET_SYSERR, gettext_noop ("Could not find matching reservation"));
@@ -898,6 +899,7 @@ handle_get (void *cls,
                  "Empty result set for `%s' request.\n",
                  "GET");
 #endif 
+      GNUNET_SERVER_client_keep (client);
       transmit_item (client,
                     NULL, NULL, 0, NULL, 0, 0, 0, 
                     GNUNET_TIME_UNIT_ZERO_ABS, 0);
@@ -1068,7 +1070,6 @@ handle_remove (void *cls,
   GNUNET_CRYPTO_hash (&dm[1],
                      ntohl(dm->size),
                      &vhash);
-  GNUNET_SERVER_client_keep (client);
   plugin->api->get (plugin->api->cls,
                    &dm->key,
                    &vhash,
@@ -1194,6 +1195,11 @@ cleaning_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 {
   unload_plugin (plugin);
   plugin = NULL;
+  if (filter != NULL)
+    {
+      GNUNET_CONTAINER_bloomfilter_free (filter);
+      filter = NULL;
+    }
 }
 
 
@@ -1295,6 +1301,7 @@ run (void *cls,
   if (NULL == plugin)
     {
       GNUNET_CONTAINER_bloomfilter_free (filter);
+      filter = NULL;
       return;
     }
   GNUNET_SERVER_disconnect_notify (server, &cleanup_reservations, NULL);