aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2019-12-12 15:10:47 +0100
committerDaniel Stenberg <daniel@haxx.se>2019-12-13 08:16:24 +0100
commit197d8aaf6db97db8ae06ccee828e7d6c46a22f4e (patch)
treef4ef6feb862d37abb3dcf91b8f2aacaea5a74e2f /tests
parent6a15d1d4e574e7c41c67aa752c27ba0a3db21610 (diff)
lib1559: fix mem-leak in OOM
Closes #4709
Diffstat (limited to 'tests')
-rw-r--r--tests/libtest/lib1559.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/tests/libtest/lib1559.c b/tests/libtest/lib1559.c
index 2aa3615e0..e1b417548 100644
--- a/tests/libtest/lib1559.c
+++ b/tests/libtest/lib1559.c
@@ -34,6 +34,9 @@ int test(char *URL)
CURLU *u;
(void)URL;
+ if(!longurl)
+ return 1;
+
memset(longurl, 'a', EXCESSIVE);
longurl[EXCESSIVE-1] = 0;
@@ -62,15 +65,8 @@ int test(char *URL)
curl_url_cleanup(u);
}
- free(longurl);
-
- curl_easy_cleanup(curl);
- curl_global_cleanup();
-
- return 0;
-
test_cleanup:
-
+ free(longurl);
curl_easy_cleanup(curl);
curl_global_cleanup();