]> git.saurik.com Git - wxWidgets.git/commitdiff
Fixed bug in wxDialUpManagerMSW::GetISPNames - uses realloc() without checking for...
authorJulian Smart <julian@anthemion.co.uk>
Fri, 14 Mar 2008 14:18:15 +0000 (14:18 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Fri, 14 Mar 2008 14:18:15 +0000 (14:18 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52494 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/dialup.cpp

index b708fb4612c07853dc7bec9c94ca604ae1ec7ee9..566c31c3353eb4d008f747e47e93dbb8d3a844ff 100644 (file)
@@ -709,7 +709,13 @@ size_t wxDialUpManagerMSW::GetISPNames(wxArrayString& names) const
         if ( dwRet == ERROR_BUFFER_TOO_SMALL )
         {
             // reallocate the buffer
-            rasEntries = (RASENTRYNAME *)realloc(rasEntries, size);
+            void *n  = realloc(rasEntries, size);
+            if (n == NULL)
+            {
+                free(rasEntries);
+                return 0;
+            }
+            rasEntries = (RASENTRYNAME *)n;
         }
         else if ( dwRet != 0 )
         {