aboutsummaryrefslogtreecommitdiff
path: root/lib/progress.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/progress.c')
-rw-r--r--lib/progress.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/progress.c b/lib/progress.c
index 35847fab4..b2372aa53 100644
--- a/lib/progress.c
+++ b/lib/progress.c
@@ -387,6 +387,7 @@ void ProgressInit(struct UrlData *data, int max/*, int options, int moremax*/)
/* 20000318 mgs */
int scr_size [2];
#endif
+ char *colp;
if(data->conf&(CONF_NOPROGRESS|CONF_MUTE))
return;
@@ -399,8 +400,11 @@ void ProgressInit(struct UrlData *data, int max/*, int options, int moremax*/)
/* 20000318 mgs
* OS/2 users most likely won't have this env var set, and besides that
* we're using our own way to determine screen width */
- if (curl_GetEnv("COLUMNS") != NULL)
- width = atoi(curl_GetEnv("COLUMNS"));
+ colp = curl_GetEnv("COLUMNS");
+ if (colp != NULL) {
+ width = atoi(colp);
+ free(colp);
+ }
else
width = 79;
#else