Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Missing APPDATA and USERPROFILE environment variables cause error "curl: (27) Out of memory" #4644
I did this
I expected the following
The problem is curl depends on
Points to address:
The solution is
Feel free to close.
homedir function looks in this order for win32
CURLE_OUT_OF_MEMORY could happen but only if built with ssh support:
Broken (albeit inadvertently) in fb3845a which was over 9 years ago. Prior to that it didn't work right anyway without a homedir, it appears it would set it to /_ssh/known_hosts.
We could fix this by moving the if(result) break; to inside the if(file) block. However there may be other places that curl expects a homedir. Do you know why those variables are not set for you?
This "out of memory" error is in this case just a wrong error message since curl couldn't continue anyway. The reason for the wrong error message is of course that
I think shell32 may have some problems if run from a service (ie curl is run by a service and not a normal user account), so I'm not sure we'd want curl/libcurl to depend on it. I think it's possible to try for appdata location from the registry as a backup if env var is empty, maybe that would be better.. @captain-caveman2k opinion?
Yes, the curl is executed in cgi script.
Agreed, I was able to fix this on my end rather easily. Actually my first thought was that the environment is broken because of the cgi, but the error message indicating far more severe error state held me from digging in that first. Hence this issue.
Not in my case, but yeah...
I think it would, the cgi host was purging envvars only and not e.g. registry read permissions. Other CGI servers could though.
I am surprised myself, this should have surfaced many times before. However I am quite convinced that #3117 issue had the same culprit, same symptoms and I wouldn't be surprised if his java server or his mingw stripped the envvars. Just a speculation though.
I would be quite happy with simply more descriptive error message. The