From 251a07fb907a713c98840364997498d110bd5ca6 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Fri, 14 Mar 2008 14:18:24 +0000 Subject: [PATCH] Fixed bug in wxDialUpManagerMSW::GetISPNames - uses realloc() without checking for NULL, leading to a memory leak (Sebastian Gottschalk) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@52495 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/dialup.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/msw/dialup.cpp b/src/msw/dialup.cpp index bdd82582cb..5f44e6886d 100644 --- a/src/msw/dialup.cpp +++ b/src/msw/dialup.cpp @@ -711,7 +711,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 ) {