diff options
author | Christian Grothoff <christian@grothoff.org> | 2019-09-16 22:11:04 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2019-09-16 22:11:04 +0200 |
commit | 2a84699d90ed4780c8a816eccaac3229e9543e40 (patch) | |
tree | fa50f83d60807f729c565accffca2e02c6454dcd /src/lib/merchant_api_tip_authorize.c | |
parent | 27720961219c16cd11890634ce7934850219511e (diff) | |
download | merchant-2a84699d90ed4780c8a816eccaac3229e9543e40.tar.gz merchant-2a84699d90ed4780c8a816eccaac3229e9543e40.tar.bz2 merchant-2a84699d90ed4780c8a816eccaac3229e9543e40.zip |
fixing misc memory leaks related to json, including #5769, as well as an unrelated use-after-free
Diffstat (limited to 'src/lib/merchant_api_tip_authorize.c')
-rw-r--r-- | src/lib/merchant_api_tip_authorize.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/lib/merchant_api_tip_authorize.c b/src/lib/merchant_api_tip_authorize.c index d77041c7..f79064a6 100644 --- a/src/lib/merchant_api_tip_authorize.c +++ b/src/lib/merchant_api_tip_authorize.c @@ -88,7 +88,7 @@ check_ok (struct TALER_MERCHANT_TipAuthorizeOperation *tao, struct GNUNET_JSON_Specification spec[] = { GNUNET_JSON_spec_string ("taler_tip_uri", &taler_tip_uri), GNUNET_JSON_spec_fixed_auto ("tip_id", &tip_id), - GNUNET_JSON_spec_end() + GNUNET_JSON_spec_end () }; if (GNUNET_OK != @@ -96,8 +96,12 @@ check_ok (struct TALER_MERCHANT_TipAuthorizeOperation *tao, spec, NULL, NULL)) { + char *log; + GNUNET_break_op (0); - GNUNET_log (GNUNET_ERROR_TYPE_INFO, "JSON %s\n", json_dumps (json, 0)); + log = json_dumps (json, 0); + GNUNET_log (GNUNET_ERROR_TYPE_INFO, "JSON %s\n", log); + free (log); return GNUNET_SYSERR; } tao->cb (tao->cb_cls, @@ -132,7 +136,7 @@ handle_tip_authorize_finished (void *cls, { case MHD_HTTP_OK: if (GNUNET_OK != check_ok (tao, - json)) + json)) { GNUNET_break_op (0); response_code = 0; @@ -255,7 +259,8 @@ TALER_MERCHANT_tip_authorize (struct GNUNET_CURL_Context *ctx, * @param tao handle to the tracking operation being cancelled */ void -TALER_MERCHANT_tip_authorize_cancel (struct TALER_MERCHANT_TipAuthorizeOperation *tao) +TALER_MERCHANT_tip_authorize_cancel (struct + TALER_MERCHANT_TipAuthorizeOperation *tao) { if (NULL != tao->job) { |