fix remaining leak from #5050

This commit is contained in:
Christian Grothoff 2017-06-04 12:24:51 +02:00
parent 4694810d9d
commit 2f74a5b00e
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC

View File

@ -413,8 +413,7 @@ parse_json_auditor (struct TALER_EXCHANGE_AuditorInformation *auditor,
struct TALER_AuditorSignatureP auditor_sig; struct TALER_AuditorSignatureP auditor_sig;
struct GNUNET_HashCode denom_h; struct GNUNET_HashCode denom_h;
const struct TALER_EXCHANGE_DenomPublicKey *dk; const struct TALER_EXCHANGE_DenomPublicKey *dk;
unsigned int j; struct GNUNET_JSON_Specification kspec[] = {
struct GNUNET_JSON_Specification spec[] = {
GNUNET_JSON_spec_fixed_auto ("denom_pub_h", GNUNET_JSON_spec_fixed_auto ("denom_pub_h",
&denom_h), &denom_h),
GNUNET_JSON_spec_fixed_auto ("auditor_sig", GNUNET_JSON_spec_fixed_auto ("auditor_sig",
@ -424,14 +423,14 @@ parse_json_auditor (struct TALER_EXCHANGE_AuditorInformation *auditor,
if (GNUNET_OK != if (GNUNET_OK !=
GNUNET_JSON_parse (key, GNUNET_JSON_parse (key,
spec, kspec,
NULL, NULL)) NULL, NULL))
{ {
GNUNET_break_op (0); GNUNET_break_op (0);
continue; continue;
} }
dk = NULL; dk = NULL;
for (j=0;j<key_data->num_denom_keys;j++) for (unsigned int j=0;j<key_data->num_denom_keys;j++)
{ {
if (0 == memcmp (&denom_h, if (0 == memcmp (&denom_h,
&key_data->denom_keys[j].h_key, &key_data->denom_keys[j].h_key,
@ -468,12 +467,14 @@ parse_json_auditor (struct TALER_EXCHANGE_AuditorInformation *auditor,
&auditor->auditor_pub.eddsa_pub)) &auditor->auditor_pub.eddsa_pub))
{ {
GNUNET_break_op (0); GNUNET_break_op (0);
GNUNET_JSON_parse_free (spec);
return GNUNET_SYSERR; return GNUNET_SYSERR;
} }
auditor->denom_keys[off] = dk; auditor->denom_keys[off] = dk;
off++; off++;
} }
auditor->num_denom_keys = off; auditor->num_denom_keys = off;
GNUNET_JSON_parse_free (spec);
return GNUNET_OK; return GNUNET_OK;
} }