aboutsummaryrefslogtreecommitdiff
path: root/tests/libtest/lib552.c
diff options
context:
space:
mode:
authorDan Fandrich <dan@coneharvesters.com>2017-08-19 21:27:38 +0200
committerDan Fandrich <dan@coneharvesters.com>2017-08-19 21:42:47 +0200
commitc468c27b5a8abb8134b3f89439aaac45f37d22d7 (patch)
tree94fa73f73c03b1ff79df9264332724ecaec8e82c /tests/libtest/lib552.c
parentc1a75407cc515f310b8b7caf6bbf6e6cb5fde38c (diff)
tests: Make sure libtests call curl_global_cleanup()
This ensures that global data allocations are freed so Valgrind stays happy. This was a problem with at least PolarSSL and mbedTLS.
Diffstat (limited to 'tests/libtest/lib552.c')
-rw-r--r--tests/libtest/lib552.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/tests/libtest/lib552.c b/tests/libtest/lib552.c
index 3a93dafaf..9cae45993 100644
--- a/tests/libtest/lib552.c
+++ b/tests/libtest/lib552.c
@@ -166,19 +166,15 @@ static curlioerr ioctl_callback(CURL *handle, int cmd, void *clientp)
int test(char *URL)
{
CURL *curl;
- CURLcode res = CURLE_OUT_OF_MEMORY;
+ CURLcode res = CURLE_OK;
struct data config;
size_t i;
static const char fill[] = "test data";
config.trace_ascii = 1; /* enable ascii tracing */
- curl = curl_easy_init();
- if(!curl) {
- fprintf(stderr, "curl_easy_init() failed\n");
- curl_global_cleanup();
- return TEST_ERR_MAJOR_BAD;
- }
+ global_init(CURL_GLOBAL_ALL);
+ easy_init(curl);
test_setopt(curl, CURLOPT_DEBUGFUNCTION, my_trace);
test_setopt(curl, CURLOPT_DEBUGDATA, &config);