]> granicus.if.org Git - curl/commitdiff
unit1654: cleanup on memory failure
authorDaniel Stenberg <daniel@haxx.se>
Thu, 13 Jun 2019 09:09:32 +0000 (11:09 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 13 Jun 2019 15:22:51 +0000 (17:22 +0200)
... to make it handle torture tests properly.

Reported-by: Marcel Raad
Fixes #4021
Closes #4022

tests/unit/unit1654.c

index 7532c6d61dca4a81fb86fc561d83435b439da451..9d1a3e211ace919969843b63bab8fc4931cf4fd9 100644 (file)
@@ -53,8 +53,10 @@ UNITTEST_START
   if(!asi)
     return 1;
   result = Curl_altsvc_load(asi, arg);
-  if(result)
+  if(result) {
+    Curl_altsvc_cleanup(asi);
     return result;
+  }
   curl = curl_easy_init();
   if(!curl)
     goto fail;