aboutsummaryrefslogtreecommitdiff
path: root/src/lib/merchant_api_check_payment.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2019-11-09 14:51:47 +0100
committerChristian Grothoff <christian@grothoff.org>2019-11-09 14:51:47 +0100
commitaa44ae235b484e09dbb49dfdb961a3f576205ca0 (patch)
tree230accf06ccd303f19ca62e41af193603d2d9344 /src/lib/merchant_api_check_payment.c
parentaf6293c5ef3272ad51567edb15901b7b6bfeab6b (diff)
downloadmerchant-aa44ae235b484e09dbb49dfdb961a3f576205ca0.tar.gz
merchant-aa44ae235b484e09dbb49dfdb961a3f576205ca0.tar.bz2
merchant-aa44ae235b484e09dbb49dfdb961a3f576205ca0.zip
close misc leaks, check for URL build errors
Diffstat (limited to 'src/lib/merchant_api_check_payment.c')
-rw-r--r--src/lib/merchant_api_check_payment.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/lib/merchant_api_check_payment.c b/src/lib/merchant_api_check_payment.c
index 4a9e70e1..c4c07ae9 100644
--- a/src/lib/merchant_api_check_payment.c
+++ b/src/lib/merchant_api_check_payment.c
@@ -225,6 +225,13 @@ TALER_MERCHANT_check_payment (struct GNUNET_CURL_Context *ctx,
(0 != ts) ? "timeout" : NULL,
timeout_s,
NULL);
+ if (NULL == cpo->url)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Could not construct request URL.\n");
+ GNUNET_free (cpo);
+ return NULL;
+ }
GNUNET_free (timeout_s);
eh = curl_easy_init ();
if (CURLE_OK != curl_easy_setopt (eh,
@@ -232,6 +239,9 @@ TALER_MERCHANT_check_payment (struct GNUNET_CURL_Context *ctx,
cpo->url))
{
GNUNET_break (0);
+ curl_easy_cleanup (eh);
+ GNUNET_free (cpo->url);
+ GNUNET_free (cpo);
return NULL;
}
if (CURLE_OK != curl_easy_setopt (eh,
@@ -239,6 +249,9 @@ TALER_MERCHANT_check_payment (struct GNUNET_CURL_Context *ctx,
tlong))
{
GNUNET_break (0);
+ curl_easy_cleanup (eh);
+ GNUNET_free (cpo->url);
+ GNUNET_free (cpo);
return NULL;
}
@@ -252,6 +265,8 @@ TALER_MERCHANT_check_payment (struct GNUNET_CURL_Context *ctx,
cpo)))
{
GNUNET_break (0);
+ GNUNET_free (cpo->url);
+ GNUNET_free (cpo);
return NULL;
}
return cpo;