Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
netrc: free temporary strings if memory allocation fails #3122
- Change the inout parameters after all needed memory has been allocated. Do not change them if something goes wrong. - Free the allocated temporary strings if strdup() fails
This fixes a bug found by the torture tests: https://curl.haxx.se/dev/log.cgi?id=20181007082759-19055#prob1
There appears to be a bug with this change where netrc lookup now fails to select the correct entry, instead defaulting to the first user entry every time. This was working in v7.61.1 and earlier.
Example netrc file:
The following examples running under Solaris 11 pick up the wrong netrc user entry:
curl --verbose --netrc --user fdxfer: ftp://ftp.gam.com
curl --verbose --netrc --user pilling: ftp://ftp.gam.com