summaryrefslogtreecommitdiff
path: root/src/bank-lib/bank_api_credit.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_credit.c
parentdd6bad739a7b7539952af6bebb74bfe3ffa0f9d7 (diff)
downloadexchange-a9ae2171b897dfc9635e9ab72a04d65379bf2208.tar.gz
exchange-a9ae2171b897dfc9635e9ab72a04d65379bf2208.tar.bz2
exchange-a9ae2171b897dfc9635e9ab72a04d65379bf2208.zip
reuse TALER_url_join
Diffstat (limited to 'src/bank-lib/bank_api_credit.c')
-rw-r--r--src/bank-lib/bank_api_credit.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/bank-lib/bank_api_credit.c b/src/bank-lib/bank_api_credit.c
index be4c1972e..95e91d7db 100644
--- a/src/bank-lib/bank_api_credit.c
+++ b/src/bank-lib/bank_api_credit.c
@@ -257,19 +257,27 @@ TALER_BANK_credit_history (struct GNUNET_CURL_Context *ctx,
( (0 == start_row) &&
(0 < num_results) ) )
GNUNET_asprintf (&url,
- "/history/incoming?delta=%lld",
+ "history/incoming?delta=%lld",
(long long) num_results);
else
GNUNET_asprintf (&url,
- "/history/incoming?delta=%lld&start=%llu",
+ "history/incoming?delta=%lld&start=%llu",
(long long) num_results,
start_row);
hh = GNUNET_new (struct TALER_BANK_CreditHistoryHandle);
hh->hcb = hres_cb;
hh->hcb_cls = hres_cb_cls;
+ hh->request_url = TALER_url_join (bank_base_url,
+ url,
+ NULL);
+ GNUNET_free (url);
+ if (NULL == hh->request_url)
+ {
+ GNUNET_free (hh);
+ GNUNET_break (0);
+ return NULL;
+ }
hh->bank_base_url = GNUNET_strdup (bank_base_url);
- hh->request_url = TALER_BANK_path_to_url_ (bank_base_url,
- url);
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Requesting history at `%s'\n",
hh->request_url);
@@ -285,7 +293,6 @@ TALER_BANK_credit_history (struct GNUNET_CURL_Context *ctx,
GNUNET_break (0);
TALER_BANK_credit_history_cancel (hh);
curl_easy_cleanup (eh);
- GNUNET_free (url);
return NULL;
}
hh->job = GNUNET_CURL_job_add2 (ctx,
@@ -293,7 +300,6 @@ TALER_BANK_credit_history (struct GNUNET_CURL_Context *ctx,
NULL,
&handle_history_finished,
hh);
- GNUNET_free (url);
return hh;
}