comctl32: Fix error handling in PSM_ADDPAGE in case of memory
allocation failure.
This commit is contained in:
parent
d00fe021d3
commit
3faa66ee2a
@ -2288,6 +2288,7 @@ static LRESULT PROPSHEET_QuerySiblings(HWND hwndDlg,
|
|||||||
static BOOL PROPSHEET_AddPage(HWND hwndDlg,
|
static BOOL PROPSHEET_AddPage(HWND hwndDlg,
|
||||||
HPROPSHEETPAGE hpage)
|
HPROPSHEETPAGE hpage)
|
||||||
{
|
{
|
||||||
|
PropPageInfo * ppi;
|
||||||
PropSheetInfo * psInfo = (PropSheetInfo*) GetPropW(hwndDlg,
|
PropSheetInfo * psInfo = (PropSheetInfo*) GetPropW(hwndDlg,
|
||||||
PropSheetInfoStr);
|
PropSheetInfoStr);
|
||||||
HWND hwndTabControl = GetDlgItem(hwndDlg, IDC_TABCONTROL);
|
HWND hwndTabControl = GetDlgItem(hwndDlg, IDC_TABCONTROL);
|
||||||
@ -2298,9 +2299,13 @@ static BOOL PROPSHEET_AddPage(HWND hwndDlg,
|
|||||||
/*
|
/*
|
||||||
* Allocate and fill in a new PropPageInfo entry.
|
* Allocate and fill in a new PropPageInfo entry.
|
||||||
*/
|
*/
|
||||||
psInfo->proppage = (PropPageInfo*) ReAlloc(psInfo->proppage,
|
ppi = (PropPageInfo*) ReAlloc(psInfo->proppage,
|
||||||
sizeof(PropPageInfo) *
|
sizeof(PropPageInfo) *
|
||||||
(psInfo->nPages + 1));
|
(psInfo->nPages + 1));
|
||||||
|
if (!ppi)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
psInfo->proppage = ppi;
|
||||||
if (!PROPSHEET_CollectPageInfo(ppsp, psInfo, psInfo->nPages))
|
if (!PROPSHEET_CollectPageInfo(ppsp, psInfo, psInfo->nPages))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user