summaryrefslogtreecommitdiff
path: root/tests/unit/unit1605.c
diff options
context:
space:
mode:
authorDan Fandrich <dan@coneharvesters.com>2017-04-30 10:54:26 +0200
committerDan Fandrich <dan@coneharvesters.com>2017-04-30 10:55:20 +0200
commit8089dcfc5d4b34b15cee1f1cc9b3124c0279d41b (patch)
treeea2d07b42ff6e3ceb6632de553dd4d36638796c9 /tests/unit/unit1605.c
parent65c6caacaee87f2b09aa03e5eed1bcbd9e356f68 (diff)
downloadcurl-8089dcfc5d4b34b15cee1f1cc9b3124c0279d41b.tar.gz
tests: fixed OOM handling of unit tests to abort test
It's dangerous to continue to run the test when a memory alloc fails.
Diffstat (limited to 'tests/unit/unit1605.c')
-rw-r--r--tests/unit/unit1605.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/unit/unit1605.c b/tests/unit/unit1605.c
index c807cb3f2..2fe3a5aca 100644
--- a/tests/unit/unit1605.c
+++ b/tests/unit/unit1605.c
@@ -34,9 +34,10 @@ static void unit_stop(void)
}
UNITTEST_START
- CURL *easy = curl_easy_init();
int len;
char *esc;
+ CURL *easy = curl_easy_init();
+ abort_unless(easy, "out of memory");
esc = curl_easy_escape(easy, "", -1);
fail_unless(esc == NULL, "negative string length can't work");