[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnurl] 292/411: tests: add missing global_init/cleanup calls
From: |
gnunet |
Subject: |
[gnurl] 292/411: tests: add missing global_init/cleanup calls |
Date: |
Wed, 13 Jan 2021 01:21:47 +0100 |
This is an automated email from the git hooks/post-receive script.
nikita pushed a commit to branch master
in repository gnurl.
commit 95d30409becbcc45bba2488fdc9cceef9b32a2a5
Author: Daniel Stenberg <daniel@haxx.se>
AuthorDate: Mon Nov 2 08:26:40 2020 +0100
tests: add missing global_init/cleanup calls
Without the cleanup call in these test files, the mbedTLS backend leaks
memory.
Closes #6156
---
tests/libtest/lib1523.c | 7 +++++--
tests/libtest/lib1911.c | 2 ++
tests/unit/unit1654.c | 2 ++
3 files changed, 9 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;
}
diff --git a/tests/libtest/lib1911.c b/tests/libtest/lib1911.c
index 3fafd286a..694edef33 100644
--- a/tests/libtest/lib1911.c
+++ b/tests/libtest/lib1911.c
@@ -38,6 +38,7 @@ int test(char *URL)
int error = 0;
(void)URL;
+ curl_global_init(CURL_GLOBAL_ALL);
easy = curl_easy_init();
if(!easy)
return 1;
@@ -83,5 +84,6 @@ int test(char *URL)
}
}
curl_easy_cleanup(easy);
+ curl_global_cleanup();
return error;
}
diff --git a/tests/unit/unit1654.c b/tests/unit/unit1654.c
index 79f1efe95..b9538e83d 100644
--- a/tests/unit/unit1654.c
+++ b/tests/unit/unit1654.c
@@ -56,6 +56,7 @@ UNITTEST_START
Curl_altsvc_cleanup(&asi);
return result;
}
+ curl_global_init(CURL_GLOBAL_ALL);
curl = curl_easy_init();
if(!curl)
goto fail;
@@ -129,6 +130,7 @@ UNITTEST_START
Curl_altsvc_save(curl, asi, outname);
curl_easy_cleanup(curl);
+ curl_global_cleanup();
fail:
Curl_altsvc_cleanup(&asi);
return unitfail;
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [gnurl] 278/411: CURLOPT_DNS_USE_GLOBAL_CACHE.3: fix typo, (continued)
- [gnurl] 278/411: CURLOPT_DNS_USE_GLOBAL_CACHE.3: fix typo, gnunet, 2021/01/12
- [gnurl] 329/411: Revert "libcurl.pc: make it relocatable", gnunet, 2021/01/12
- [gnurl] 327/411: Curl_pgrsStartNow: init speed limit time stamps at start, gnunet, 2021/01/12
- [gnurl] 310/411: KNOWN_BUGS: FTPS with Schannel times out file list operation, gnunet, 2021/01/12
- [gnurl] 295/411: travis: use valgrind when running tests for debug builds, gnunet, 2021/01/12
- [gnurl] 342/411: CURLOPT_HSTS.3: document the file format, gnunet, 2021/01/12
- [gnurl] 290/411: http: pass correct header size to debug callback for chunked post, gnunet, 2021/01/12
- [gnurl] 377/411: socks: check for DNS entries with the right port number, gnunet, 2021/01/12
- [gnurl] 372/411: file: avoid duplicated code sequence, gnunet, 2021/01/12
- [gnurl] 376/411: curl_setup: USE_RESOLVE_ON_IPS is for Apple native resolver use, gnunet, 2021/01/12
- [gnurl] 292/411: tests: add missing global_init/cleanup calls,
gnunet <=
- [gnurl] 356/411: openssl: guard against OOM on context creation, gnunet, 2021/01/12
- [gnurl] 280/411: mailmap: set Viktor Szakats's email, gnunet, 2021/01/12
- [gnurl] 269/411: CI/appveyor: disable test 571 in two cmake builds, gnunet, 2021/01/12
- [gnurl] 326/411: ngtcp2: adapt to recent nghttp3 updates, gnunet, 2021/01/12
- [gnurl] 411/411: add lowercase curl, gnunet, 2021/01/12
- [gnurl] 393/411: SECURITY-PROCESS: disclose on hackerone, gnunet, 2021/01/12
- [gnurl] 385/411: openssl: free mem_buf in error path, gnunet, 2021/01/12
- [gnurl] 397/411: ftp: retry getpeername for FTP with TCP_FASTOPEN, gnunet, 2021/01/12
- [gnurl] 406/411: RELEASE-NOTES: synced, gnunet, 2021/01/12
- [gnurl] 398/411: Revert "multi: implement wait using winsock events", gnunet, 2021/01/12