From 8089dcfc5d4b34b15cee1f1cc9b3124c0279d41b Mon Sep 17 00:00:00 2001 From: Dan Fandrich Date: Sun, 30 Apr 2017 10:54:26 +0200 Subject: tests: fixed OOM handling of unit tests to abort test It's dangerous to continue to run the test when a memory alloc fails. --- tests/unit/unit1605.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tests/unit/unit1605.c') 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"); -- cgit v1.2.3