diff options
author | Yang Tse <yangsita@gmail.com> | 2011-10-22 14:46:49 +0200 |
---|---|---|
committer | Yang Tse <yangsita@gmail.com> | 2011-10-22 14:49:02 +0200 |
commit | cc76bbe79b405f2c2c01155f18cca1491e084d5c (patch) | |
tree | 00bc07f6f2f29f4bc1e75bb8aac57f3fb6caa5db /src/tool_operate.c | |
parent | d7934b8bd49114cbb54f7401742f7fb088e2f796 (diff) | |
download | curl-cc76bbe79b405f2c2c01155f18cca1491e084d5c.tar.gz |
tool_operate.c: OOM handling fix
Move curl_easy_perform source code geneartion out of curl_easy_perform's loop
for proper OOM handling and source code geneartion.
Diffstat (limited to 'src/tool_operate.c')
-rw-r--r-- | src/tool_operate.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/tool_operate.c b/src/tool_operate.c index 65f4b60b8..7ab815f83 100644 --- a/src/tool_operate.c +++ b/src/tool_operate.c @@ -1208,12 +1208,13 @@ int operate(struct Configurable *config, int argc, argv_item_t argv[]) retry_sleep = retry_sleep_default; /* ms */ retrystart = tvnow(); + if(!curl_slist_append(easysrc, "ret = curl_easy_perform(hnd);")) { + res = CURLE_OUT_OF_MEMORY; + goto show_error; + } + for(;;) { res = curl_easy_perform(curl); - if(!curl_slist_append(easysrc, "ret = curl_easy_perform(hnd);")) { - res = CURLE_OUT_OF_MEMORY; - goto show_error; - } if(config->content_disposition && outs.stream && !config->mute && outs.filename) |