# Verify data after the test has been "shot"
<verify>
<file name="log/memdump">
+MEM easy.c: malloc()
MEM lib558.c: malloc()
MEM lib558.c: free()
MEM dynbuf.c: realloc()
MEM dynbuf.c: realloc()
MEM escape.c: free()
+MEM easy.c: free()
</file>
<stripfile>
s/^MEM escape.c:\d+ free\(\(nil\)\)[\n]$//
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2021, 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
/* DNS cache injection */
struct curl_slist *dns_cache_list;
+ res_global_init(CURL_GLOBAL_ALL);
+ if(res) {
+ return res;
+ }
+
msnprintf(redirect, sizeof(redirect), "google.com:%s:%s", libtest_arg2,
libtest_arg3);
dns_cache_list = curl_slist_append(NULL, redirect);
if(!dns_cache_list) {
fprintf(stderr, "curl_slist_append() failed\n");
+ curl_global_cleanup();
return TEST_ERR_MAJOR_BAD;
}
- res_global_init(CURL_GLOBAL_ALL);
- if(res) {
- curl_slist_free_all(dns_cache_list);
- return res;
- }
-
easy_init(easy);
easy_setopt(easy, CURLOPT_URL, URL);
else {
curl_slist_free_all(dns_cache_list);
curl_easy_cleanup(easy);
+ curl_global_cleanup();
return CURLE_OUT_OF_MEMORY;
}
{
CURLcode ret;
CURL *hnd;
+ curl_global_init(CURL_GLOBAL_ALL);
hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_URL, URL);
curl_easy_cleanup(hnd);
hnd = NULL;
+ curl_global_cleanup();
return (int)ret;
}
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 2019 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 2019 - 2021, 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
CURLSH *sh = NULL;
CURL *ch = NULL;
int unfinished;
+ CURLM *cm;
- CURLM *cm = curl_multi_init();
- if(!cm)
+ curl_global_init(CURL_GLOBAL_ALL);
+
+ cm = curl_multi_init();
+ if(!cm) {
+ curl_global_cleanup();
return 1;
+ }
sh = curl_share_init();
if(!sh)
goto cleanup;
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2021, 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
curl_global_init(CURL_GLOBAL_ALL);
easy = curl_easy_init();
- if(!easy)
+ if(!easy) {
+ curl_global_cleanup();
return 1;
+ }
/* make it a zero terminated C string with just As */
memset(buffer, 'A', MAX_INPUT_LENGTH + 1);
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2021, 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
easy = curl_easy_init();
if(!easy) {
fprintf(stderr, "curl_easy_init() failed\n");
- return TEST_ERR_MAJOR_BAD;
+ res = TEST_ERR_MAJOR_BAD;
}
+ else {
+ asize = (int)sizeof(a);
- asize = (int)sizeof(a);
+ s = curl_easy_escape(easy, (const char *)a, asize);
- s = curl_easy_escape(easy, (const char *)a, asize);
+ if(s) {
+ printf("%s\n", s);
+ curl_free(s);
+ }
- if(s) {
- printf("%s\n", s);
- curl_free(s);
- }
+ s = curl_easy_escape(easy, "", 0);
+ if(s) {
+ printf("IN: '' OUT: '%s'\n", s);
+ curl_free(s);
+ }
+ s = curl_easy_escape(easy, " 123", 3);
+ if(s) {
+ printf("IN: ' 12' OUT: '%s'\n", s);
+ curl_free(s);
+ }
- s = curl_easy_escape(easy, "", 0);
- if(s) {
- printf("IN: '' OUT: '%s'\n", s);
- curl_free(s);
- }
- s = curl_easy_escape(easy, " 123", 3);
- if(s) {
- printf("IN: ' 12' OUT: '%s'\n", s);
- curl_free(s);
+ curl_easy_cleanup(easy);
}
-
- curl_easy_cleanup(easy);
curl_global_cleanup();
- return 0;
+ return (int)res;
}
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2021, 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
global_init(CURL_GLOBAL_ALL);
data = curl_easy_init();
- if(!data)
+ if(!data) {
+ curl_global_cleanup();
return CURLE_OUT_OF_MEMORY;
+ }
return res;
}
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2021, 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
global_init(CURL_GLOBAL_ALL);
data = curl_easy_init();
- if(!data)
+ if(!data) {
+ curl_global_cleanup();
return CURLE_OUT_OF_MEMORY;
+ }
return res;
}
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2021, 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
{
int rc;
data = curl_easy_init();
- if(!data)
+ if(!data) {
+ curl_global_cleanup();
return CURLE_OUT_OF_MEMORY;
+ }
rc = Curl_mk_dnscache(&hp);
if(rc) {
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2021, 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
global_init(CURL_GLOBAL_ALL);
easy = curl_easy_init();
- if(!easy)
+ if(!easy) {
+ curl_global_cleanup();
return CURLE_OUT_OF_MEMORY;
+ }
return res;
}
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2021, 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
global_init(CURL_GLOBAL_ALL);
easy = curl_easy_init();
- if(!easy)
+ if(!easy) {
+ curl_global_cleanup();
return CURLE_OUT_OF_MEMORY;
+ }
return res;
}
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2021, 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
global_init(CURL_GLOBAL_ALL);
easy = curl_easy_init();
- if(!easy)
+ if(!easy) {
+ curl_global_cleanup();
return CURLE_OUT_OF_MEMORY;
+ }
return res;
}
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2021, 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
static void unit_stop(void)
{
-
+ curl_global_cleanup();
}
UNITTEST_START
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2021, 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
global_init(CURL_GLOBAL_ALL);
data = curl_easy_init();
- if(!data)
+ if(!data) {
+ curl_global_cleanup();
return CURLE_OUT_OF_MEMORY;
+ }
curl_easy_setopt(data, CURLOPT_DEBUGFUNCTION, debugf_cb);
curl_easy_setopt(data, CURLOPT_VERBOSE, 1L);
return CURLE_OK;
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 2019 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 2019 - 2021, 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
curl_global_cleanup();
fail:
Curl_altsvc_cleanup(&asi);
+ curl_global_cleanup();
return unitfail;
}
UNITTEST_STOP
CURL *easy;
if(!h)
return 1;
+
+ curl_global_init(CURL_GLOBAL_ALL);
easy = curl_easy_init();
- if(!easy)
+ if(!easy) {
+ Curl_hsts_cleanup(&h);
+ curl_global_cleanup();
return 1;
+ }
Curl_hsts_loadfile(easy, h, "log/input1660");
(void)Curl_hsts_save(easy, h, "log/hsts1660");
Curl_hsts_cleanup(&h);
curl_easy_cleanup(easy);
+ curl_global_cleanup();
return unitfail;
}
UNITTEST_STOP