]> granicus.if.org Git - curl/commitdiff
unit1651: survive curl_easy_init() fails
authorDaniel Stenberg <daniel@haxx.se>
Mon, 18 Feb 2019 11:29:23 +0000 (12:29 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 19 Feb 2019 08:08:28 +0000 (09:08 +0100)
tests/unit/unit1651.c

index fcd3b54db0a00c6f3b4bbab2d598d9305f44dd96..db3a0f35b37b8b55038e0691e09e52a31d1bee15 100644 (file)
@@ -5,7 +5,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 2018, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 2018 - 2019, 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
@@ -352,6 +352,8 @@ UNITTEST_START
   struct Curl_easy *data = curl_easy_init();
   int i;
   int byte;
+  if(!data)
+    return 2;
 
   memset(&conn, 0, sizeof(struct connectdata));
   /* this is a lot of assuming, but we expect the parsing function to only