From: Steve Holme Date: Sun, 23 Mar 2014 11:01:10 +0000 (+0000) Subject: tool_operate: Fixed uninitialised variable under some error situations X-Git-Tag: upstream/7.37.1~429 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3ebfaf6a0399b6adeb7def7c322586c449a72af4;p=platform%2Fupstream%2Fcurl.git tool_operate: Fixed uninitialised variable under some error situations For example when a URL is not specified or the headers file fails to open. --- diff --git a/src/tool_operate.c b/src/tool_operate.c index 689f769..1b75394 100644 --- a/src/tool_operate.c +++ b/src/tool_operate.c @@ -205,8 +205,9 @@ static CURLcode operate_do(struct GlobalConfig *global, int res = 0; unsigned long li; - bool orig_noprogress; - bool orig_isatty; + /* Save the values of noprogress and isatty to restore them later on */ + bool orig_noprogress = global->noprogress; + bool orig_isatty = global->isatty; errorbuffer[0] = '\0'; @@ -336,10 +337,6 @@ static CURLcode operate_do(struct GlobalConfig *global, } } - /* save the values of noprogress and isatty to restore them later on */ - orig_noprogress = global->noprogress; - orig_isatty = global->isatty; - /* ** Nested loops start here. */