summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorGregory Muchka <36249295+Greg-Muchka@users.noreply.github.com>2021-06-15 18:12:49 -0600
committerDaniel Stenberg <daniel@haxx.se>2021-06-21 14:05:49 +0200
commit62be0960858f18798f5f2bf662cbfd9ae3948eb4 (patch)
tree21bbc30441d585da96b344097725801c9747dc6b /CMakeLists.txt
parent47386775ed53c0c4258ea9ec15d3499bb93a887f (diff)
downloadcurl-62be0960858f18798f5f2bf662cbfd9ae3948eb4.tar.gz
hostip: (macOS) free returned memory of 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 Closes #7265
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt27
1 files changed, 14 insertions, 13 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index cf4f3c579..4badbe996 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -372,28 +372,29 @@ if(CMAKE_USE_DARWINSSL)
message(FATAL_ERROR "The cmake option CMAKE_USE_DARWINSSL was renamed to CMAKE_USE_SECTRANSP.")
endif()
-if(CMAKE_USE_SECTRANSP)
+if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
find_library(COREFOUNDATION_FRAMEWORK "CoreFoundation")
if(NOT COREFOUNDATION_FRAMEWORK)
message(FATAL_ERROR "CoreFoundation framework not found")
endif()
- find_library(SECURITY_FRAMEWORK "Security")
- if(NOT SECURITY_FRAMEWORK)
- message(FATAL_ERROR "Security framework not found")
- endif()
-
- set(SSL_ENABLED ON)
- set(USE_SECTRANSP ON)
- list(APPEND CURL_LIBS "-framework CoreFoundation" "-framework Security")
-endif()
-
-if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
find_library(SYSTEMCONFIGURATION_FRAMEWORK "SystemConfiguration")
if(NOT SYSTEMCONFIGURATION_FRAMEWORK)
message(FATAL_ERROR "SystemConfiguration framework not found")
endif()
- list(APPEND CURL_LIBS "-framework SystemConfiguration")
+
+ list(APPEND CURL_LIBS "-framework CoreFoundation" "-framework SystemConfiguration")
+
+ if(CMAKE_USE_SECTRANSP)
+ find_library(SECURITY_FRAMEWORK "Security")
+ if(NOT SECURITY_FRAMEWORK)
+ message(FATAL_ERROR "Security framework not found")
+ endif()
+
+ set(SSL_ENABLED ON)
+ set(USE_SECTRANSP ON)
+ list(APPEND CURL_LIBS "-framework Security")
+ endif()
endif()
if(CMAKE_USE_OPENSSL)