remove protocol violation
[oweals/gnunet.git] / src / dht / plugin_block_dht.c
index a21167fb03a9fe62b957e4d419b850a0fac20af6..1ecb39e27d6c31d137a24713ebd24bab222d58f5 100644 (file)
@@ -147,6 +147,7 @@ block_plugin_dht_get_key (void *cls, enum GNUNET_BLOCK_Type type,
     return GNUNET_NO;
   }
   hello = block;
+  memset (key, 0, sizeof (*key));
   pid = (struct GNUNET_PeerIdentity *) key;
   if (GNUNET_OK != GNUNET_HELLO_get_id (hello, pid))
   {
@@ -172,7 +173,7 @@ libgnunet_plugin_block_dht_init (void *cls)
   };
   struct GNUNET_BLOCK_PluginFunctions *api;
 
-  api = GNUNET_malloc (sizeof (struct GNUNET_BLOCK_PluginFunctions));
+  api = GNUNET_new (struct GNUNET_BLOCK_PluginFunctions);
   api->evaluate = &block_plugin_dht_evaluate;
   api->get_key = &block_plugin_dht_get_key;
   api->types = types;