Commit 3faa66ee authored by Thomas Weidenmueller's avatar Thomas Weidenmueller Committed by Alexandre Julliard

comctl32: Fix error handling in PSM_ADDPAGE in case of memory

allocation failure.
parent d00fe021
...@@ -2288,6 +2288,7 @@ static LRESULT PROPSHEET_QuerySiblings(HWND hwndDlg, ...@@ -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, ...@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment