{
/**
- * The signature for this credential by the issuer
+ * Signature meta
*/
- struct GNUNET_CRYPTO_EcdsaSignature signature;
+ struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
/**
- * Signature meta
+ * The signature for this credential by the issuer
*/
- struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
+ struct GNUNET_CRYPTO_EcdsaSignature signature;
/**
* Public key of the issuer
GNUNET_memcpy (&del[1], tmp_str, attr_len);
- if (GNUNET_OK !=
- GNUNET_CRYPTO_ecdsa_sign (issuer, &del->purpose, &del->signature))
- {
- GNUNET_break (0);
- GNUNET_free (del);
- return NULL;
- }
+ GNUNET_CRYPTO_ecdsa_sign (issuer, del, &del->signature);
dele = GNUNET_malloc (sizeof (struct GNUNET_ABD_Delegate) + attr_len);
dele->signature = del->signature;
unsigned int rd_count,
const struct GNUNET_GNSRECORD_Data *rd)
{
- struct GNUNET_GNSRECORD_Data rdn[rd_count + 1];
struct GNUNET_GNSRECORD_Data *rde;
+ struct GNUNET_GNSRECORD_Data* rdn =
+ GNUNET_malloc(sizeof(*rdn)*(rd_count + 1));
memset (rdn, 0, sizeof (struct GNUNET_GNSRECORD_Data));
- GNUNET_memcpy (&rdn[1], rd, rd_count * sizeof (struct GNUNET_GNSRECORD_Data));
+ GNUNET_memcpy (&rdn[1], rd,
+ rd_count * sizeof (struct GNUNET_GNSRECORD_Data));
rde = &rdn[0];
rde->data = data;
rde->data_size = data_size;
rde,
&add_continuation,
&add_qe);
-
+ GNUNET_free(rdn);
return;
}
if (GNUNET_OK !=
GNUNET_GNSRECORD_string_to_value (type, subject, &data, &data_size))
{
- fprintf (stderr,
- "Value `%s' invalid for record type `%s'\n",
- subject,
- typestring);
+ if(typestring == NULL) {
+ fputs("No value for unknown record type\n", stderr);
+ } else if(subject == NULL) {
+ fprintf(stderr,
+ "No value for record type`%s'\n",
+ typestring);
+ } else {
+ fprintf (stderr,
+ "Value `%s' invalid for record type `%s'\n",
+ subject,
+ typestring);
+ }
GNUNET_SCHEDULER_shutdown ();
return;
}
int i;
while (NULL != (tok = strtok (NULL, ",")))
count++;
- struct GNUNET_ABD_Delegate delegates[count];
+ struct GNUNET_ABD_Delegate* delegates =
+ GNUNET_malloc(sizeof(*delegates)*count);
struct GNUNET_ABD_Delegate *dele;
GNUNET_free (tmp);
tmp = GNUNET_strdup (subject_delegate);
NULL);
for (i = 0; i < count; i++)
{
- GNUNET_free ((char *) delegates[i].issuer_attribute);
+ GNUNET_free_nz ((char *) delegates[i].issuer_attribute);
+ delegates[i].issuer_attribute = NULL;
}
GNUNET_free (tmp);
+ GNUNET_free(delegates);
}
else
{
(char *) &sets[1]);
for (i = 0; i < entries; i++)
{
- if (0 != set[i].subject_attribute_len)
- GNUNET_free ((char *) set[i].subject_attribute);
+ if (0 != set[i].subject_attribute_len) {
+ GNUNET_free_nz ((char *) set[i].subject_attribute);
+ set[i].subject_attribute = NULL;
+ }
}
sets->set_count = htonl (entries);
sets->data_size = GNUNET_htonll (tmp_data_size);