commit bbca0b654ba921247aa79e02ea43e5f5e1e57496
parent a378a81ca755665d1e5aa914e03b1894fc8361ac
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date: Sun, 17 Oct 2021 19:31:08 +0300
test_tricky: fixed leaked resource
Diffstat:
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/testcurl/test_tricky.c b/src/testcurl/test_tricky.c
@@ -753,9 +753,11 @@ performTestQueries (struct MHD_Daemon *d, int d_port,
if (tricky_url)
{
#if CURL_AT_LEAST_VERSION (7, 62, 0)
- qParam.url = curl_url ();
- if (NULL == qParam.url)
+ CURLU *url;
+ url = curl_url ();
+ if (NULL == url)
externalErrorExit ();
+ qParam.url = url;
if ((CURLUE_OK != curl_url_set (qParam.url, CURLUPART_SCHEME, "http", 0)) ||
(CURLUE_OK != curl_url_set (qParam.url, CURLUPART_HOST, URL_HOST,
@@ -811,7 +813,7 @@ performTestQueries (struct MHD_Daemon *d, int d_port,
if (! ahc_param->header_check_param.found_header4)
mhdErrorExitDesc ("Required header4 was not detected in request");
}
-
+ curl_url_cleanup (url);
#else
fprintf (stderr, "This test requires libcurl version 7.62.0 or newer.\n");
abort ();