Thomas Weidenmueller : comctl32: Fix error handling in PSM_ADDPAGE in
case of memory
Alexandre Julliard
julliard at wine.codeweavers.com
Sat Dec 31 08:20:31 CST 2005
Module: wine
Branch: refs/heads/master
Commit: 3faa66ee2ab5274c2cb38e3364f4869e8928f8ff
URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=3faa66ee2ab5274c2cb38e3364f4869e8928f8ff
Author: Thomas Weidenmueller <wine-patches at reactsoft.com>
Date: Sat Dec 31 13:12:19 2005 +0100
comctl32: Fix error handling in PSM_ADDPAGE in case of memory
allocation failure.
---
dlls/comctl32/propsheet.c | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/dlls/comctl32/propsheet.c b/dlls/comctl32/propsheet.c
index 08c55b8..78fdc43 100644
--- a/dlls/comctl32/propsheet.c
+++ b/dlls/comctl32/propsheet.c
@@ -2288,6 +2288,7 @@ static LRESULT PROPSHEET_QuerySiblings(H
static BOOL PROPSHEET_AddPage(HWND hwndDlg,
HPROPSHEETPAGE hpage)
{
+ PropPageInfo * ppi;
PropSheetInfo * psInfo = (PropSheetInfo*) GetPropW(hwndDlg,
PropSheetInfoStr);
HWND hwndTabControl = GetDlgItem(hwndDlg, IDC_TABCONTROL);
@@ -2298,9 +2299,13 @@ static BOOL PROPSHEET_AddPage(HWND hwndD
/*
* Allocate and fill in a new PropPageInfo entry.
*/
- psInfo->proppage = (PropPageInfo*) ReAlloc(psInfo->proppage,
- sizeof(PropPageInfo) *
- (psInfo->nPages + 1));
+ ppi = (PropPageInfo*) ReAlloc(psInfo->proppage,
+ sizeof(PropPageInfo) *
+ (psInfo->nPages + 1));
+ if (!ppi)
+ return FALSE;
+
+ psInfo->proppage = ppi;
if (!PROPSHEET_CollectPageInfo(ppsp, psInfo, psInfo->nPages))
return FALSE;
More information about the wine-cvs
mailing list