File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -385,7 +385,25 @@ class winhttp_client : public _http_client_communicator
385385 }
386386 else
387387 {
388- WINHTTP_CURRENT_USER_IE_PROXY_CONFIG proxyInfo;
388+ struct raii_ie_proxy_config : WINHTTP_CURRENT_USER_IE_PROXY_CONFIG
389+ {
390+ raii_ie_proxy_config ()
391+ {
392+ memset (this , 0 , sizeof (WINHTTP_CURRENT_USER_IE_PROXY_CONFIG));
393+ }
394+
395+ ~raii_ie_proxy_config ()
396+ {
397+ if (lpszProxy)
398+ ::GlobalFree (lpszProxy);
399+ if (lpszProxyBypass)
400+ ::GlobalFree (lpszProxyBypass);
401+ if (lpszAutoConfigUrl)
402+ ::GlobalFree (lpszAutoConfigUrl);
403+ }
404+ };
405+
406+ raii_ie_proxy_config proxyInfo;
389407 BOOL result = WinHttpGetIEProxyConfigForCurrentUser (&proxyInfo);
390408 if (result && proxyInfo.lpszProxy != nullptr )
391409 {
You can’t perform that action at this time.
0 commit comments