]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
operate_do: skip superfluous check for NULL pointer
authorDaniel Stenberg <daniel@haxx.se>
Wed, 8 Oct 2014 10:21:39 +0000 (12:21 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 8 Oct 2014 10:21:39 +0000 (12:21 +0200)
Coverity CID 1243583. get_url_file_name() cannot fail and return a NULL
file name pointer so skip the check for that - it tricks coverity into
believing it can happen and it then warns later on when we use 'outfile'
without checking for NULL.

src/tool_operate.c

index 488fb08c479d37d50cfb390c3b0546320307d9d2..7448cad9cfd4d6233984e1b38d448ec830c3e427 100644 (file)
@@ -543,7 +543,7 @@ static CURLcode operate_do(struct GlobalConfig *global,
             res = get_url_file_name(&outfile, this_url);
             if(res)
               goto show_error;
-            if((!outfile || !*outfile) && !config->content_disposition) {
+            if(!*outfile && !config->content_disposition) {
               helpf(global->errors, "Remote file name has no length!\n");
               res = CURLE_WRITE_ERROR;
               goto quit_urls;