diff options
author | Daniel Stenberg <daniel@haxx.se> | 2020-11-02 08:26:40 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2020-11-02 09:14:18 +0100 |
commit | 95d30409becbcc45bba2488fdc9cceef9b32a2a5 (patch) | |
tree | 3ee750ac00e31e0e78a01c32acf6e794211a7815 /tests/libtest/lib1523.c | |
parent | 6da7a7e5ce9a54ee577403b1f38ed80c0c527988 (diff) | |
download | curl-95d30409becbcc45bba2488fdc9cceef9b32a2a5.tar.gz |
tests: add missing global_init/cleanup calls
Without the cleanup call in these test files, the mbedTLS backend leaks
memory.
Closes #6156
Diffstat (limited to 'tests/libtest/lib1523.c')
-rw-r--r-- | tests/libtest/lib1523.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/libtest/lib1523.c b/tests/libtest/lib1523.c index 170527d84..0c4a34096 100644 --- a/tests/libtest/lib1523.c +++ b/tests/libtest/lib1523.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -56,8 +56,10 @@ static CURLcode run(CURL *hnd, long limit, long time) int test(char *URL) { CURLcode ret; - CURL *hnd = curl_easy_init(); + CURL *hnd; char buffer[CURL_ERROR_SIZE]; + curl_global_init(CURL_GLOBAL_ALL); + hnd = curl_easy_init(); curl_easy_setopt(hnd, CURLOPT_URL, URL); curl_easy_setopt(hnd, CURLOPT_WRITEFUNCTION, write_cb); curl_easy_setopt(hnd, CURLOPT_ERRORBUFFER, buffer); @@ -77,6 +79,7 @@ int test(char *URL) printf("End: %d\n", time(NULL)); curl_easy_cleanup(hnd); + curl_global_cleanup(); return (int)ret; } |