-skeletons for transport-ng
[oweals/gnunet.git] / src / gnsrecord / plugin_gnsrecord_dns.c
index 63fdce5f30b3a78e1e2a54ace72504b302fee199..aa64f0dd65fc506aac8fb4dd78a77241e9e22334 100644 (file)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet
-     Copyright (C) 2013, 2014 Christian Grothoff (and other contributing authors)
+     Copyright (C) 2013, 2014 GNUnet e.V.
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
@@ -265,7 +265,7 @@ dns_value_to_string (void *cls,
  * @return the value, 0 if not found
  */
 static unsigned int
-rfc4394_mnemonic_to_value (const char *mnemonic)
+rfc4398_mnemonic_to_value (const char *mnemonic)
 {
   static struct {
     const char *mnemonic;
@@ -425,7 +425,7 @@ dns_string_to_value (void *cls,
       sdup = GNUNET_strdup (s);
       typep = strtok (sdup, " ");
       if ( (NULL == typep) ||
-           ( (0 == (type = rfc4394_mnemonic_to_value (typep))) &&
+           ( (0 == (type = rfc4398_mnemonic_to_value (typep))) &&
              ( (1 != SSCANF (typep,
                              "%u",
                              &type)) ||
@@ -444,6 +444,7 @@ dns_string_to_value (void *cls,
         GNUNET_free (sdup);
         return GNUNET_SYSERR;
       }
+      alg = 0;
       algp = strtok (NULL, " ");
       if ( (NULL == algp) ||
            ( (0 == (type = rfc4034_mnemonic_to_value (typep))) &&
@@ -488,7 +489,6 @@ dns_string_to_value (void *cls,
           GNUNET_free (cert_data);
           return GNUNET_SYSERR;
         }
-        GNUNET_free (cert_data);
         *data_size = off;
         *data = GNUNET_malloc (off);
         memcpy (*data, certbuf, off);