[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r34700 - in gnunet/src: multicast psyc
From: |
gnunet |
Subject: |
[GNUnet-SVN] r34700 - in gnunet/src: multicast psyc |
Date: |
Fri, 19 Dec 2014 22:54:51 +0100 |
Author: grothoff
Date: 2014-12-19 22:54:51 +0100 (Fri, 19 Dec 2014)
New Revision: 34700
Modified:
gnunet/src/multicast/gnunet-service-multicast.c
gnunet/src/psyc/gnunet-service-psyc.c
gnunet/src/psyc/test_psyc.c
Log:
-fix leaks, check RV
Modified: gnunet/src/multicast/gnunet-service-multicast.c
===================================================================
--- gnunet/src/multicast/gnunet-service-multicast.c 2014-12-19 21:47:34 UTC
(rev 34699)
+++ gnunet/src/multicast/gnunet-service-multicast.c 2014-12-19 21:54:51 UTC
(rev 34700)
@@ -1185,7 +1185,7 @@
struct Member *mem = (struct Member *) chn->grp;
client_send_join_decision (mem, hdcsn);
-
+ GNUNET_free (hdcsn);
if (GNUNET_YES == ntohs (dcsn->is_admitted))
{
chn->join_status = JOIN_ADMITTED;
Modified: gnunet/src/psyc/gnunet-service-psyc.c
===================================================================
--- gnunet/src/psyc/gnunet-service-psyc.c 2014-12-19 21:47:34 UTC (rev
34699)
+++ gnunet/src/psyc/gnunet-service-psyc.c 2014-12-19 21:54:51 UTC (rev
34700)
@@ -1642,6 +1642,7 @@
sizeof (*req), relay_size, join_msg_size, req_size);
GNUNET_break (0);
GNUNET_SERVER_client_disconnect (client);
+ GNUNET_free (slv);
return;
}
if (0 < slv->relay_count)
@@ -1753,14 +1754,21 @@
client_recv_join_decision (void *cls, struct GNUNET_SERVER_Client *client,
const struct GNUNET_MessageHeader *msg)
{
- struct Channel *
- chn = GNUNET_SERVER_client_get_user_context (client, struct Channel);
+ const struct GNUNET_PSYC_JoinDecisionMessage *dcsn
+ = (const struct GNUNET_PSYC_JoinDecisionMessage *) msg;
+ struct Channel *chn;
+ struct Master *mst;
+ struct JoinDecisionClosure jcls;
+
+ chn = GNUNET_SERVER_client_get_user_context (client, struct Channel);
+ if (NULL == chn)
+ {
+ GNUNET_break (0);
+ GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
+ return;
+ }
GNUNET_assert (GNUNET_YES == chn->is_master);
- struct Master *mst = (struct Master *) chn;
-
- struct GNUNET_PSYC_JoinDecisionMessage *
- dcsn = (struct GNUNET_PSYC_JoinDecisionMessage *) msg;
- struct JoinDecisionClosure jcls;
+ mst = (struct Master *) chn;
jcls.is_admitted = ntohl (dcsn->is_admitted);
jcls.msg
= (sizeof (*dcsn) + sizeof (*jcls.msg) <= ntohs (msg->size))
@@ -2266,6 +2274,7 @@
GNUNET_SERVER_notification_context_add (nc, opcls->client);
GNUNET_SERVER_notification_context_unicast (nc, opcls->client, &op->header,
GNUNET_NO);
+ GNUNET_free (op);
return GNUNET_YES;
}
Modified: gnunet/src/psyc/test_psyc.c
===================================================================
--- gnunet/src/psyc/test_psyc.c 2014-12-19 21:47:34 UTC (rev 34699)
+++ gnunet/src/psyc/test_psyc.c 2014-12-19 21:54:51 UTC (rev 34700)
@@ -201,7 +201,7 @@
state_get_var (void *cls, const char *name, const void *value, size_t
value_size)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Got state var: %s\n%.*s\n", name, value_size, value);
+ "Got state var: %s\n%.*s\n", name, value_size, value);
}
@@ -694,7 +694,7 @@
}
-void
+static void
join_decision_cb (void *cls,
const struct GNUNET_PSYC_JoinDecisionMessage *dcsn,
int is_admitted,
@@ -715,7 +715,7 @@
}
-void
+static void
join_request_cb (void *cls,
const struct GNUNET_PSYC_JoinRequestMessage *req,
const struct GNUNET_CRYPTO_EcdsaPublicKey *slave_key,
@@ -734,7 +734,7 @@
}
-void
+static void
slave_connect_cb (void *cls, int result, uint64_t max_message_id)
{
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
@@ -745,7 +745,7 @@
}
-void
+static void
slave_join ()
{
GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Joining slave.\n");
@@ -764,6 +764,7 @@
&slave_message_cb, &slave_message_part_cb,
&slave_connect_cb, &join_decision_cb, NULL,
join_msg);
+ GNUNET_free (join_msg);
slv_chn = GNUNET_PSYC_slave_get_channel (slv);
GNUNET_ENV_environment_destroy (env);
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r34700 - in gnunet/src: multicast psyc,
gnunet <=