removing GNUNET_CRYPTO_ecc_key_free, use GNUNET_free directly instead
[oweals/gnunet.git] / src / identity / identity_api.c
index f4ef81f6893e110cf3731d6bac03a75994a193bb..d5035ba4980ce5458b76f26dab6fffaf18840c93 100644 (file)
@@ -368,7 +368,7 @@ message_handler (void *cls,
                     GNUNET_CONTAINER_multihashmap_remove (h->egos,
                                                           &ego->id,
                                                           ego));
-      GNUNET_CRYPTO_ecc_key_free (ego->pk);
+      GNUNET_free (ego->pk);
       GNUNET_free (ego->name);
       GNUNET_free (ego);
     }
@@ -398,13 +398,11 @@ message_handler (void *cls,
       reschedule_connect (h);
       return;
     }
+    /* Note: we know which service this should be for, so we're not
+       really using 'str' henceforth */
     GNUNET_CRYPTO_ecc_key_get_public (&sdm->private_key,
                                      &pub);
     GNUNET_CRYPTO_hash (&pub, sizeof (pub), &id);
-    if (0 == name_len)
-      str = NULL;
-    else
-      str = (const char *) &sdm[1];
     ego = GNUNET_CONTAINER_multihashmap_get (h->egos,
                                             &id);
     if (NULL == ego)
@@ -417,6 +415,7 @@ message_handler (void *cls,
     GNUNET_CONTAINER_DLL_remove (h->op_head,
                                 h->op_tail,
                                 op);
+    GNUNET_free (ego->name);
     if (NULL != op->cb)
       op->cb (op->cls,
              ego,
@@ -731,7 +730,7 @@ GNUNET_IDENTITY_create (struct GNUNET_IDENTITY_Handle *id,
   if (slen >= GNUNET_SERVER_MAX_MESSAGE_SIZE - sizeof (struct GNUNET_IDENTITY_CreateRequestMessage))
   {
     GNUNET_break (0);
-    GNUNET_CRYPTO_ecc_key_free (pk);
+    GNUNET_free (pk);
     return NULL;
   }
   op = GNUNET_malloc (sizeof (struct GNUNET_IDENTITY_Operation) +
@@ -754,7 +753,7 @@ GNUNET_IDENTITY_create (struct GNUNET_IDENTITY_Handle *id,
                                    op);
   if (NULL == id->th)
     transmit_next (id);
-  GNUNET_CRYPTO_ecc_key_free (pk);
+  GNUNET_free (pk);
   return op;
 }
 
@@ -925,7 +924,7 @@ free_ego (void *cls,
         ego,
         &ego->ctx,
         NULL);
-  GNUNET_CRYPTO_ecc_key_free (ego->pk);
+  GNUNET_free (ego->pk);
   GNUNET_free (ego->name);
   GNUNET_free (ego);
   return GNUNET_OK;