From 4899a467bb6cd3624cdd907cb4f7cdaede620c73 Mon Sep 17 00:00:00 2001 From: Matthias Wachs Date: Thu, 9 Aug 2012 09:31:18 +0000 Subject: [PATCH] bug --- src/namestore/namestore_common.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/namestore/namestore_common.c b/src/namestore/namestore_common.c index 2a9143d8e..afbaf2fc3 100644 --- a/src/namestore/namestore_common.c +++ b/src/namestore/namestore_common.c @@ -580,7 +580,6 @@ GNUNET_NAMESTORE_string_to_value (uint32_t type, return GNUNET_SYSERR; } *data_size = sizeof (struct vpn_data) + strlen (s_serv) + 1; - *data = GNUNET_malloc (*data_size); vpn = (struct vpn_data*)*data; @@ -595,9 +594,9 @@ GNUNET_NAMESTORE_string_to_value (uint32_t type, strcpy ((char*)&vpn[1], s_serv); return GNUNET_OK; case GNUNET_DNSPARSER_TYPE_TLSA: - tlsa = (struct tlsa_data*)*data; *data_size = sizeof (struct tlsa_data) + strlen (s) - 6; - tlsa = GNUNET_malloc (*data_size); + *data = GNUNET_malloc (*data_size); + tlsa = (struct tlsa_data*)*data; ret = SSCANF (s, "%c %c %c %s", &tlsa->usage, &tlsa->selector, @@ -612,7 +611,6 @@ GNUNET_NAMESTORE_string_to_value (uint32_t type, GNUNET_free (tlsa); return GNUNET_SYSERR; } - return GNUNET_OK; default: GNUNET_break (0); -- 2.25.1