summaryrefslogtreecommitdiff
path: root/src/tool_operate.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tool_operate.c')
-rw-r--r--src/tool_operate.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/tool_operate.c b/src/tool_operate.c
index f92b1bd37..ed3b2f56a 100644
--- a/src/tool_operate.c
+++ b/src/tool_operate.c
@@ -794,7 +794,7 @@ static CURLcode single_transfer(struct GlobalConfig *global,
!strcmp(state->outfiles, "-")) && urlnum > 1);
if(state->up < state->infilenum) {
- struct per_transfer *per;
+ struct per_transfer *per = NULL;
struct OutStruct *outs;
struct InStruct *input;
struct OutStruct *heads;
@@ -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 */