Skip to content

Commit

Permalink
tool_operate: reorder code to avoid compiler warning
Browse files Browse the repository at this point in the history
tool_operate.c(889) : warning C4701: potentially uninitialized local
variable 'per' use

Follow-up to cc71d35
Reported-by: Marc Hörsken
Bug: #7922 (comment)
  • Loading branch information
bagder committed Nov 8, 2021
1 parent 9e9fef9 commit e82d478
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/tool_operate.c
Original file line number Diff line number Diff line change
Expand Up @@ -879,11 +879,12 @@ static CURLcode single_transfer(struct GlobalConfig *global,
curl = curl_easy_init();
if(curl)
result = add_per_transfer(&per);
if(result || !curl) {
else
result = CURLE_OUT_OF_MEMORY;
if(result) {
curl_easy_cleanup(curl);
if(etag_save->fopened)
fclose(etag_save->stream);
result = CURLE_OUT_OF_MEMORY;
break;
}
per->etag_save = etag_first; /* copy the whole struct */
Expand Down

0 comments on commit e82d478

Please sign in to comment.