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

Free returned memory of SCDynamicStoreCopyProxies #7265

Conversation

Greg-Muchka
Copy link
Contributor

@Greg-Muchka Greg-Muchka commented Jun 16, 2021

From Apples documentation on SCDynamicStoreCopyProxies,
"Return Value: A dictionary of key-value pairs that represent the current internet proxy settings, or NULL if no proxy settings have been defined or if an error occurred. You must release the returned value."

The use of SCDynamicStoreCopyProxies without releasing the returned memory has resulted in a memory leak in curl 7.77.0.

Source: https://developer.apple.com/documentation/systemconfiguration/1517088-scdynamicstorecopyproxies

From Apples documentation on SCDynamicStoreCopyProxies, 
"Return Value: A dictionary of key-value pairs that represent the current internet proxy settings, or NULL if no proxy settings have been defined or if an error occurred. You must release the returned value."

Failure to release the returned value of SCDynamicStoreCopyProxies can result in a memory leak. 

Source: https://developer.apple.com/documentation/systemconfiguration/1517088-scdynamicstorecopyproxies
Copy link
Member

@bagder bagder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to match the mentioned document!

@bagder bagder added memory-leak name lookup DNS and related tech labels Jun 16, 2021
@bagder
Copy link
Member

bagder commented Jun 17, 2021

It seems this breaks the cmake builds?

Undefined symbols for architecture x86_64:
  "_CFRelease", referenced from:
      _Curl_resolv in hostip.c.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

@Greg-Muchka
Copy link
Contributor Author

Greg-Muchka commented Jun 17, 2021

Looks as though I will need to link in CoreFoundation

@bagder
Copy link
Member

bagder commented Jun 21, 2021

Thanks!

@bagder bagder closed this in 62be096 Jun 21, 2021
@tawmoto
Copy link

tawmoto commented Jul 9, 2021

Sorry to re-open this task, but are there any plans for a curl 7.77.1 release with this bug fixed in the near future? Thank you

@jzakrzewski
Copy link
Contributor

@tawmoto The next release is in less than 2 weeks (21st of July), so I don't think so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
memory-leak name lookup DNS and related tech
Development

Successfully merging this pull request may close these issues.

4 participants