aboutsummaryrefslogtreecommitdiff
path: root/src/mesh
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2013-11-14 17:46:23 +0000
committerBart Polot <bart@net.in.tum.de>2013-11-14 17:46:23 +0000
commit22eb104fa86f094867f40dba68f65f8f55f7e64a (patch)
tree2f1dfc3be64a03fb9a2a3e59972b008082cb50e4 /src/mesh
parent7e73f1606286a5938dcb2bc8bfc170c751b49514 (diff)
downloadgnunet-22eb104fa86f094867f40dba68f65f8f55f7e64a.tar.gz
gnunet-22eb104fa86f094867f40dba68f65f8f55f7e64a.zip
- fix memleak on KX drop
Diffstat (limited to 'src/mesh')
-rw-r--r--src/mesh/gnunet-service-mesh_tunnel.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/mesh/gnunet-service-mesh_tunnel.c b/src/mesh/gnunet-service-mesh_tunnel.c
index 1d51ab835..d4ceead50 100644
--- a/src/mesh/gnunet-service-mesh_tunnel.c
+++ b/src/mesh/gnunet-service-mesh_tunnel.c
@@ -744,10 +744,13 @@ rekey_tunnel (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
744 if (NULL != tc && 0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason)) 744 if (NULL != tc && 0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason))
745 return; 745 return;
746 746
747 t->kx_ctx = GNUNET_new (struct MeshTunnelKXCtx); 747 if (NULL == t->kx_ctx)
748 t->kx_ctx->challenge = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_NONCE, 748 {
749 UINT32_MAX); 749 t->kx_ctx = GNUNET_new (struct MeshTunnelKXCtx);
750 t->kx_ctx->d_key_old = t->d_key; 750 t->kx_ctx->challenge = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_NONCE,
751 UINT32_MAX);
752 t->kx_ctx->d_key_old = t->d_key;
753 }
751 send_ephemeral (t); 754 send_ephemeral (t);
752 if (MESH_TUNNEL3_READY == t->state || MESH_TUNNEL3_REKEY == t->state) 755 if (MESH_TUNNEL3_READY == t->state || MESH_TUNNEL3_REKEY == t->state)
753 { 756 {