diff options
author | Christian Grothoff <christian@grothoff.org> | 2023-06-04 13:26:00 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2023-06-04 13:26:00 +0200 |
commit | 809300158caaa0215c36ef89c7e38f0edfa93593 (patch) | |
tree | 1faf7e314af34db7a2333d8003ee0ed6fca91d74 /src/kyclogic/plugin_kyclogic_oauth2.c | |
parent | 9718bc4920ab4781378b777bf3e2af275c8d0575 (diff) | |
download | exchange-809300158caaa0215c36ef89c7e38f0edfa93593.tar.xz |
code cleanup, fixing misc. memory leaks in the process
Diffstat (limited to 'src/kyclogic/plugin_kyclogic_oauth2.c')
-rw-r--r-- | src/kyclogic/plugin_kyclogic_oauth2.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/kyclogic/plugin_kyclogic_oauth2.c b/src/kyclogic/plugin_kyclogic_oauth2.c index e7350f01c..c9e5d8dcf 100644 --- a/src/kyclogic/plugin_kyclogic_oauth2.c +++ b/src/kyclogic/plugin_kyclogic_oauth2.c @@ -951,12 +951,12 @@ parse_proof_success_reply (struct TALER_KYCLOGIC_ProofHandle *ph, const json_t *j) { const char *state; - json_t *data; + const json_t *data; struct GNUNET_JSON_Specification spec[] = { GNUNET_JSON_spec_string ("status", &state), - GNUNET_JSON_spec_json ("data", - &data), + GNUNET_JSON_spec_object_const ("data", + &data), GNUNET_JSON_spec_end () }; enum GNUNET_GenericReturnValue res; @@ -988,7 +988,6 @@ parse_proof_success_reply (struct TALER_KYCLOGIC_ProofHandle *ph, GNUNET_break_op (0); handle_proof_error (ph, j); - GNUNET_JSON_parse_free (spec); return; } { @@ -1016,7 +1015,6 @@ parse_proof_success_reply (struct TALER_KYCLOGIC_ProofHandle *ph, "Unexpected response from KYC gateway: data must contain id"); ph->http_status = MHD_HTTP_BAD_GATEWAY; - GNUNET_JSON_parse_free (spec); return; } ph->status = TALER_KYCLOGIC_STATUS_SUCCESS; @@ -1034,7 +1032,6 @@ parse_proof_success_reply (struct TALER_KYCLOGIC_ProofHandle *ph, } ph->attributes = data2attributes (ph->pd, data); - GNUNET_JSON_parse_free (spec); } |