fixes
authorGabor X Toth <*@tg-x.net>
Mon, 6 Jun 2016 20:31:03 +0000 (20:31 +0000)
committerGabor X Toth <*@tg-x.net>
Mon, 6 Jun 2016 20:31:03 +0000 (20:31 +0000)
src/multicast/gnunet-service-multicast.c
src/multicast/multicast_api.c
src/psyc/gnunet-service-psyc.c
src/psyc/psyc_api.c
src/psycutil/psyc_slicer.c

index f157041bc0f9d0ca9575280e6dbf993d8b1f3f93..94f9d2f88e8ce276430f830747feffae267cc7b8 100644 (file)
@@ -447,6 +447,7 @@ replay_req_remove_cadet (struct Channel *chn)
     if (c == chn)
     {
       GNUNET_CONTAINER_multihashmap_remove (grp_replay_req, &key, chn);
+      GNUNET_CONTAINER_multihashmap_iterator_destroy (it);
       return GNUNET_YES;
     }
   }
@@ -484,6 +485,7 @@ replay_req_remove_client (struct Group *grp, struct GNUNET_SERVER_Client *client
     if (c == client)
     {
       GNUNET_CONTAINER_multihashmap_remove (replay_req_client, &key, client);
+      GNUNET_CONTAINER_multihashmap_iterator_destroy (it);
       return GNUNET_YES;
     }
   }
@@ -759,7 +761,7 @@ cadet_send_channel (struct Channel *chn, const struct GNUNET_MessageHeader *msg)
                                           GNUNET_TIME_UNIT_FOREVER_REL,
                                           ntohs (msg->size),
                                           &cadet_notify_transmit_ready,
-                                          (void *) msg);
+                                          tcls);
   GNUNET_assert (NULL != chn->tmit_handle);
 }
 
index 09e7a8d42a94c913e40e1edb459ea2ea85a96c1d..ce36ef6f2b423dd67fdf66e5dacce1cac4b4a897 100644 (file)
@@ -204,9 +204,10 @@ static void
 group_send_connect_msg (struct GNUNET_MULTICAST_Group *grp)
 {
   uint16_t cmsg_size = ntohs (grp->connect_msg->size);
-  struct GNUNET_MessageHeader * cmsg = GNUNET_malloc (cmsg_size);
+  struct GNUNET_MessageHeader *cmsg = GNUNET_malloc (cmsg_size);
   memcpy (cmsg, grp->connect_msg, cmsg_size);
   GNUNET_CLIENT_MANAGER_transmit_now (grp->client, cmsg);
+  GNUNET_free (cmsg);
 }
 
 
index dc5697a07c1a205889619be28f4b78a4371c1bf7..8fd2fbf35fb544b4e23c213c5d08946393b90471 100644 (file)
@@ -866,7 +866,7 @@ store_recv_fragment_replay_result (void *cls, int64_t result,
   case GNUNET_SYSERR:
     GNUNET_MULTICAST_replay_response (rh, NULL,
                                       GNUNET_MULTICAST_REC_INTERNAL_ERROR);
-    break;
+    return;
   }
   GNUNET_MULTICAST_replay_response_end (rh);
 }
@@ -2006,7 +2006,6 @@ transmit_notify (void *cls, size_t *data_size, void *data)
     send_message_ack (chn, tmit_msg->client);
 
   GNUNET_CONTAINER_DLL_remove (chn->tmit_head, chn->tmit_tail, tmit_msg);
-  GNUNET_free (tmit_msg);
 
   if (NULL != chn->tmit_head)
   {
@@ -2016,8 +2015,10 @@ transmit_notify (void *cls, size_t *data_size, void *data)
            && tmit_msg->last_ptype < GNUNET_MESSAGE_TYPE_PSYC_MESSAGE_END)
   {
     /* FIXME: handle partial message (when still in_transmit) */
+    GNUNET_free (tmit_msg);
     return GNUNET_SYSERR;
   }
+  GNUNET_free (tmit_msg);
   return ret;
 }
 
@@ -2393,6 +2394,8 @@ store_recv_fragment_history (void *cls,
 
   /** @todo FIXME: send only to requesting client */
   client_send_msg (chn, &res->header);
+
+  GNUNET_free (res);
   return GNUNET_YES;
 }
 
@@ -2528,6 +2531,7 @@ store_recv_state_var (void *cls, const char *name,
   GNUNET_SERVER_notification_context_add (nc, op->client);
   GNUNET_SERVER_notification_context_unicast (nc, op->client, &res->header,
                                               GNUNET_NO);
+  GNUNET_free (res);
   return GNUNET_YES;
 }
 
index 018eb63ad61e37510f8d7ca9f352eeceb390d200..441c74a08296419bbd5b7c76ae853a0ad815e4ab 100644 (file)
@@ -223,9 +223,10 @@ static void
 channel_send_connect_msg (struct GNUNET_PSYC_Channel *chn)
 {
   uint16_t cmsg_size = ntohs (chn->connect_msg->size);
-  struct GNUNET_MessageHeader * cmsg = GNUNET_malloc (cmsg_size);
+  struct GNUNET_MessageHeader *cmsg = GNUNET_malloc (cmsg_size);
   memcpy (cmsg, chn->connect_msg, cmsg_size);
   GNUNET_CLIENT_MANAGER_transmit_now (chn->client, cmsg);
+  GNUNET_free (cmsg);
 }
 
 
@@ -762,6 +763,7 @@ GNUNET_PSYC_join_decision (struct GNUNET_PSYC_JoinHandle *jh,
     memcpy (&dcsn[1], join_resp, join_resp_size);
 
   GNUNET_CLIENT_MANAGER_transmit (chn->client, &dcsn->header);
+  GNUNET_free (dcsn);
   GNUNET_free (jh);
   return GNUNET_OK;
 }
@@ -1078,6 +1080,7 @@ GNUNET_PSYC_channel_slave_add (struct GNUNET_PSYC_Channel *chn,
                                                             result_cb, cls));
 
   GNUNET_CLIENT_MANAGER_transmit (chn->client, &req->header);
+  GNUNET_free (req);
 }
 
 
@@ -1129,6 +1132,7 @@ GNUNET_PSYC_channel_slave_remove (struct GNUNET_PSYC_Channel *chn,
                                                             result_cb, cls));
 
   GNUNET_CLIENT_MANAGER_transmit (chn->client, &req->header);
+  GNUNET_free (req);
 }
 
 
@@ -1169,6 +1173,7 @@ channel_history_replay (struct GNUNET_PSYC_Channel *chn,
   memcpy (&req[1], method_prefix, method_size);
 
   GNUNET_CLIENT_MANAGER_transmit (chn->client, &req->header);
+  GNUNET_free (req);
   return hist;
 }
 
@@ -1309,6 +1314,7 @@ channel_state_get (struct GNUNET_PSYC_Channel *chn,
   memcpy (&req[1], name, name_size);
 
   GNUNET_CLIENT_MANAGER_transmit (chn->client, &req->header);
+  GNUNET_free (req);
   return sr;
 }
 
index a9c96ff048143d3d1d6f56fcabd1ab641a4a4b76..b641d972157e556ae64569c6a6d2e092c2a78d6e 100644 (file)
@@ -341,6 +341,7 @@ GNUNET_PSYC_slicer_message_part (struct GNUNET_PSYC_Slicer *slicer,
     slicer->mod_value_remaining = slicer->mod_full_value_size;
     slicer->mod_value_size
       = ntohs (mod->header.size) - sizeof (*mod) - slicer->mod_name_size;
+    // fall through
   }
   case GNUNET_MESSAGE_TYPE_PSYC_MESSAGE_MOD_CONT:
     if (ptype == GNUNET_MESSAGE_TYPE_PSYC_MESSAGE_MOD_CONT)