gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r30706 - gnunet/src/mesh


From: gnunet
Subject: [GNUnet-SVN] r30706 - gnunet/src/mesh
Date: Thu, 14 Nov 2013 18:46:23 +0100

Author: bartpolot
Date: 2013-11-14 18:46:23 +0100 (Thu, 14 Nov 2013)
New Revision: 30706

Modified:
   gnunet/src/mesh/gnunet-service-mesh_tunnel.c
Log:
- fix memleak on KX drop


Modified: gnunet/src/mesh/gnunet-service-mesh_tunnel.c
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh_tunnel.c        2013-11-14 17:40:06 UTC 
(rev 30705)
+++ gnunet/src/mesh/gnunet-service-mesh_tunnel.c        2013-11-14 17:46:23 UTC 
(rev 30706)
@@ -744,10 +744,13 @@
   if (NULL != tc && 0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason))
     return;
 
-  t->kx_ctx = GNUNET_new (struct MeshTunnelKXCtx);
-  t->kx_ctx->challenge = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_NONCE,
-                                                   UINT32_MAX);
-  t->kx_ctx->d_key_old = t->d_key;
+  if (NULL == t->kx_ctx)
+  {
+    t->kx_ctx = GNUNET_new (struct MeshTunnelKXCtx);
+    t->kx_ctx->challenge = GNUNET_CRYPTO_random_u32 
(GNUNET_CRYPTO_QUALITY_NONCE,
+                                                     UINT32_MAX);
+    t->kx_ctx->d_key_old = t->d_key;
+  }
   send_ephemeral (t);
   if (MESH_TUNNEL3_READY == t->state || MESH_TUNNEL3_REKEY == t->state)
   {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]