Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

url: silence MSVC warning #5638

Merged
merged 1 commit into from
Jul 2, 2020
Merged

Conversation

MarcelRaad
Copy link
Member

Since commit f3d501d, if proxy support is disabled, MSVC warns:
url.c : warning C4701: potentially uninitialized local variable
'hostaddr' used
url.c : error C4703: potentially uninitialized local pointer variable
'hostaddr' used

That could actually only happen if both conn->bits.proxy and
CURL_DISABLE_PROXY were enabled.
Initialize it to NULL to silence the warning.

Since commit f3d501d, if proxy support is disabled, MSVC warns:
url.c : warning C4701: potentially uninitialized local variable
'hostaddr' used
url.c : error C4703: potentially uninitialized local pointer variable
'hostaddr' used

That could actually only happen if both `conn->bits.proxy` and
`CURL_DISABLE_PROXY` were enabled.
Initialize it to NULL to silence the warning.

Closes curl#5638
@MarcelRaad MarcelRaad closed this in 19b96ba Jul 2, 2020
@MarcelRaad MarcelRaad merged commit 19b96ba into curl:master Jul 2, 2020
@MarcelRaad MarcelRaad deleted the url_msvc_warning branch July 16, 2020 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants