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/trunk@52494 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -709,7 +709,13 @@ size_t wxDialUpManagerMSW::GetISPNames(wxArrayString& names) const
|
|||||||
if ( dwRet == ERROR_BUFFER_TOO_SMALL )
|
if ( dwRet == ERROR_BUFFER_TOO_SMALL )
|
||||||
{
|
{
|
||||||
// reallocate the buffer
|
// 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 )
|
else if ( dwRet != 0 )
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user