diff options
author | Bart Polot <bart@net.in.tum.de> | 2013-11-14 17:46:23 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2013-11-14 17:46:23 +0000 |
commit | 22eb104fa86f094867f40dba68f65f8f55f7e64a (patch) | |
tree | 2f1dfc3be64a03fb9a2a3e59972b008082cb50e4 /src/mesh | |
parent | 7e73f1606286a5938dcb2bc8bfc170c751b49514 (diff) | |
download | gnunet-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.c | 11 |
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 | { |