]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
tool_operate: fix implicit call to easysrc_cleanup
authorJay Satiro <raysatiro@yahoo.com>
Mon, 22 Jul 2019 19:43:41 +0000 (15:43 -0400)
committerJay Satiro <raysatiro@yahoo.com>
Tue, 23 Jul 2019 14:44:55 +0000 (10:44 -0400)
easysrc_cleanup is only defined when CURL_DISABLE_LIBCURL_OPTION is not
defined, and prior to this change would be called regardless.

Bug: https://github.com/curl/curl/pull/3804#issuecomment-513922637
Reported-by: Marcel Raad
Closes https://github.com/curl/curl/pull/4142

src/tool_operate.c

index 6b2d89ffb3d4f9b41b55894a4eedf5f33c669fb7..68cd11c56dcae3169e0519f305379f2769619816 100644 (file)
@@ -2286,8 +2286,12 @@ CURLcode operate(struct GlobalConfig *config, int argc, argv_item_t argv[])
         struct OperationConfig *operation = config->first;
         CURLSH *share = curl_share_init();
         if(!share) {
-          /* Cleanup the libcurl source output */
-          easysrc_cleanup();
+#ifndef CURL_DISABLE_LIBCURL_OPTION
+          if(config->libcurl) {
+            /* Cleanup the libcurl source output */
+            easysrc_cleanup();
+          }
+#endif
           return CURLE_OUT_OF_MEMORY;
         }