Alexandre Julliard : winhttp: Avoid casting away const.

Alexandre Julliard julliard at winehq.org
Wed Jul 22 09:35:51 CDT 2009


Module: wine
Branch: master
Commit: af77e9b388cf53ac379ed572d2383e1e3a5e3b13
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=af77e9b388cf53ac379ed572d2383e1e3a5e3b13

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Wed Jul 22 14:48:09 2009 +0200

winhttp: Avoid casting away const.

---

 dlls/winhttp/session.c |   24 ++++++++++++------------
 1 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/dlls/winhttp/session.c b/dlls/winhttp/session.c
index 81113e4..27509e1 100644
--- a/dlls/winhttp/session.c
+++ b/dlls/winhttp/session.c
@@ -886,16 +886,16 @@ BOOL WINAPI WinHttpGetDefaultProxyConfiguration( WINHTTP_PROXY_INFO *info )
                     if (hdr->flags & WINHTTP_PROXY_TYPE_PROXY)
                     {
                        BOOL sane = FALSE;
+                       LPWSTR proxy = NULL;
+                       LPWSTR proxy_bypass = NULL;
 
                         /* Sanity-check length of proxy string */
                         if ((BYTE *)len - buf + *len <= size)
                         {
                             sane = TRUE;
-                            info->lpszProxy = GlobalAlloc( 0,
-                                (*len + 1) * sizeof(WCHAR) );
-                            if (info->lpszProxy)
-                                copy_char_to_wchar_sz( (BYTE *)(len + 1),
-                                    *len, (LPWSTR)info->lpszProxy );
+                            proxy = GlobalAlloc( 0, (*len + 1) * sizeof(WCHAR) );
+                            if (proxy)
+                                copy_char_to_wchar_sz( (BYTE *)(len + 1), *len, proxy );
                             len = (DWORD *)((BYTE *)(len + 1) + *len);
                         }
                         if (sane)
@@ -903,19 +903,19 @@ BOOL WINAPI WinHttpGetDefaultProxyConfiguration( WINHTTP_PROXY_INFO *info )
                             /* Sanity-check length of proxy bypass string */
                             if ((BYTE *)len - buf + *len <= size)
                             {
-                                info->lpszProxyBypass = GlobalAlloc( 0,
-                                    (*len + 1) * sizeof(WCHAR) );
-                                if (info->lpszProxyBypass)
-                                    copy_char_to_wchar_sz( (BYTE *)(len + 1),
-                                        *len, (LPWSTR)info->lpszProxyBypass );
+                                proxy_bypass = GlobalAlloc( 0, (*len + 1) * sizeof(WCHAR) );
+                                if (proxy_bypass)
+                                    copy_char_to_wchar_sz( (BYTE *)(len + 1), *len, proxy_bypass );
                             }
                             else
                             {
                                 sane = FALSE;
-                                GlobalFree( (LPWSTR)info->lpszProxy );
-                                info->lpszProxy = NULL;
+                                GlobalFree( proxy );
+                                proxy = NULL;
                             }
                         }
+                        info->lpszProxy = proxy;
+                        info->lpszProxyBypass = proxy_bypass;
                         if (sane)
                         {
                             got_from_reg = TRUE;




More information about the wine-cvs mailing list