[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnurl] 115/150: unit1307: proper cleanup on OOM to fix tor
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnurl] 115/150: unit1307: proper cleanup on OOM to fix torture tests |
Date: |
Fri, 30 Mar 2018 16:49:29 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnurl.
commit c87c71b3fea35e23eb2d236278e9956555394fc1
Author: Dan Fandrich <address@hidden>
AuthorDate: Fri Mar 2 20:51:59 2018 +0100
unit1307: proper cleanup on OOM to fix torture tests
---
tests/unit/unit1607.c | 26 ++++++++++++++++++--------
1 file changed, 18 insertions(+), 8 deletions(-)
diff --git a/tests/unit/unit1607.c b/tests/unit/unit1607.c
index 3e53d4d20..135030cac 100644
--- a/tests/unit/unit1607.c
+++ b/tests/unit/unit1607.c
@@ -30,6 +30,12 @@
static struct Curl_easy *easy;
struct curl_hash *hostcache;
+static void unit_stop(void)
+{
+ curl_easy_cleanup(easy);
+ curl_global_cleanup();
+}
+
static CURLcode unit_setup(void)
{
int res = CURLE_OK;
@@ -37,22 +43,20 @@ static CURLcode unit_setup(void)
global_init(CURL_GLOBAL_ALL);
easy = curl_easy_init();
- if(!easy)
+ if(!easy) {
+ curl_global_cleanup();
return CURLE_OUT_OF_MEMORY;
+ }
hostcache = Curl_global_host_cache_init();
- if(!hostcache)
+ if(!hostcache) {
+ unit_stop();
return CURLE_OUT_OF_MEMORY;
+ }
return res;
}
-static void unit_stop(void)
-{
- curl_easy_cleanup(easy);
- curl_global_cleanup();
-}
-
struct testcase {
/* host:port:address[,address]... */
const char *optval;
@@ -128,11 +132,17 @@ UNITTEST_START
easy->dns.hostcachetype = HCACHE_GLOBAL;
list = curl_slist_append(NULL, tests[i].optval);
+ if(!list)
+ goto unit_test_abort;
curl_easy_setopt(easy, CURLOPT_RESOLVE, list);
Curl_loadhostpairs(easy);
entry_id = (void *)aprintf("%s:%d", tests[i].host, tests[i].port);
+ if(!entry_id) {
+ curl_slist_free_all(list);
+ goto unit_test_abort;
+ }
dns = Curl_hash_pick(easy->dns.hostcache, entry_id, strlen(entry_id) + 1);
free(entry_id);
entry_id = NULL;
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnurl] 58/150: schannel: fix "no previous prototype" compiler warning, (continued)
- [GNUnet-SVN] [gnurl] 58/150: schannel: fix "no previous prototype" compiler warning, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 56/150: build-openssl.bat: Follow up to 648679ab8e to suppress copy/move output, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 90/150: CURLOPT_HEADER.3: clarify problems with different data sizes, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 89/150: test1556: verify >16KB headers to the header callback, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 94/150: CURLOPT_RESOLVE: Add support for multiple IP addresses per entry, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 120/150: curl.1: mention how to add numerical IP addresses in NO_PROXY, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 35/150: http2: set DEBUG_HTTP2 to enable more HTTP/2 logging, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 65/150: tlsauthtype.d: works only if libcurl is built with TLS-SRP support, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 76/150: KNOWN_BUGS: 2.5 curl should not offer "ALPN: h2" when using https-proxy, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 96/150: hostip: fix 'potentially uninitialized variable' warning, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 115/150: unit1307: proper cleanup on OOM to fix torture tests,
gnunet <=
- [GNUnet-SVN] [gnurl] 39/150: fnmatch: accept an alphanum to be followed by a non-alphanum in char set, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 54/150: schannel: fix compiler warnings, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 103/150: os400: add curl_resolver_start_callback type to ILE/RPG binding, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 81/150: ssh: add two missing state names, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 86/150: http: fix the max header length detection logic, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 128/150: http2: verbose output new MAX_CONCURRENT_STREAMS values, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 69/150: libcurl-security.3: mention the URL standards problems too, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 77/150: TODO: 18.18 retry on network is unreachable, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 124/150: WolfSSL: adding TLSv1.3, gnunet, 2018/03/30
- [GNUnet-SVN] [gnurl] 137/150: FTP: reject path components with control codes, gnunet, 2018/03/30