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

Greg-Muchka added 2 commits 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."

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

Source: https://developer.apple.com/documentation/systemconfiguration/1517088-scdynamicstorecopyproxies
@bagder
bagder approved these changes Jun 16, 2021
Copy link
Member

@bagder bagder left a comment

Seems to match the mentioned document!

@bagder
Copy link
Member

@bagder 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 Greg-Muchka commented Jun 17, 2021

Looks as though I will need to link in CoreFoundation

@bagder
Copy link
Member

@bagder bagder commented Jun 21, 2021

Thanks!

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

@tawmoto 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

@jzakrzewski jzakrzewski commented Jul 9, 2021

@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
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants