aboutsummaryrefslogtreecommitdiff
path: root/src/bank-lib/bank_api_debit.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-01-16 21:57:40 +0100
committerChristian Grothoff <christian@grothoff.org>2020-01-16 21:57:40 +0100
commita9ae2171b897dfc9635e9ab72a04d65379bf2208 (patch)
tree11d67216d1c5594a4048d333b56ac40b4cf0acd1 /src/bank-lib/bank_api_debit.c
parentdd6bad739a7b7539952af6bebb74bfe3ffa0f9d7 (diff)
reuse TALER_url_join
Diffstat (limited to 'src/bank-lib/bank_api_debit.c')
-rw-r--r--src/bank-lib/bank_api_debit.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/bank-lib/bank_api_debit.c b/src/bank-lib/bank_api_debit.c
index 1afe0e457..652dde8d5 100644
--- a/src/bank-lib/bank_api_debit.c
+++ b/src/bank-lib/bank_api_debit.c
@@ -254,19 +254,26 @@ TALER_BANK_debit_history (struct GNUNET_CURL_Context *ctx,
( (0 == start_row) &&
(0 < num_results) ) )
GNUNET_asprintf (&url,
- "/history/outgoing?delta=%lld",
+ "history/outgoing?delta=%lld",
(long long) num_results);
else
GNUNET_asprintf (&url,
- "/history/outgoing?delta=%lld&start=%llu",
+ "history/outgoing?delta=%lld&start=%llu",
(long long) num_results,
start_row);
hh = GNUNET_new (struct TALER_BANK_DebitHistoryHandle);
hh->hcb = hres_cb;
hh->hcb_cls = hres_cb_cls;
- hh->request_url = TALER_BANK_path_to_url_ (account_base_url,
- url);
-
+ hh->request_url = TALER_url_join (account_base_url,
+ url,
+ NULL);
+ GNUNET_free (url);
+ if (NULL == hh->request_url)
+ {
+ GNUNET_free (hh);
+ GNUNET_break (0);
+ return NULL;
+ }
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Requesting history at `%s'\n",
hh->request_url);
@@ -282,7 +289,6 @@ TALER_BANK_debit_history (struct GNUNET_CURL_Context *ctx,
GNUNET_break (0);
TALER_BANK_debit_history_cancel (hh);
curl_easy_cleanup (eh);
- GNUNET_free (url);
return NULL;
}
hh->job = GNUNET_CURL_job_add2 (ctx,
@@ -290,7 +296,6 @@ TALER_BANK_debit_history (struct GNUNET_CURL_Context *ctx,
NULL,
&handle_history_finished,
hh);
- GNUNET_free (url);
return hh;
}