X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Fidentity-attribute%2Fidentity_attribute.c;h=dc2753fcab9c5a88113f585ff8711fdbbbc6c102;hb=f40acfa927bb605c81c99ed250277d51bf951e25;hp=0111668feba6ee58949aa07104dc58f15679cf5b;hpb=82e4a63b4ef0f5de0cfaedd6f8789c4a1ccfed91;p=oweals%2Fgnunet.git diff --git a/src/identity-attribute/identity_attribute.c b/src/identity-attribute/identity_attribute.c index 0111668fe..dc2753fca 100644 --- a/src/identity-attribute/identity_attribute.c +++ b/src/identity-attribute/identity_attribute.c @@ -336,18 +336,15 @@ GNUNET_IDENTITY_ATTRIBUTE_list_dup (const struct GNUNET_IDENTITY_ATTRIBUTE_Claim struct GNUNET_IDENTITY_ATTRIBUTE_ClaimListEntry *le; struct GNUNET_IDENTITY_ATTRIBUTE_ClaimListEntry *result_le; struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList *result; - size_t len; result = GNUNET_new (struct GNUNET_IDENTITY_ATTRIBUTE_ClaimList); for (le = attrs->list_head; NULL != le; le = le->next) { result_le = GNUNET_new (struct GNUNET_IDENTITY_ATTRIBUTE_ClaimListEntry); - len = sizeof (struct GNUNET_IDENTITY_ATTRIBUTE_Claim) + le->claim->data_size; - result_le->claim = GNUNET_malloc (len); - GNUNET_memcpy (result_le->claim, - le->claim, - len); - result_le->claim->name = (const char*)&result_le->claim[1]; + result_le->claim = GNUNET_IDENTITY_ATTRIBUTE_claim_new (le->claim->name, + le->claim->type, + le->claim->data, + le->claim->data_size); GNUNET_CONTAINER_DLL_insert (result->list_head, result->list_tail, result_le);