wineconsole: Avoid some fatal errors.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2017-05-17 22:20:40 +02:00
parent d321cdcd28
commit 9032849d06
3 changed files with 5 additions and 10 deletions

View File

@ -76,7 +76,7 @@ static LPWSTR WINECON_CreateKeyName(LPCWSTR kn)
LPWSTR ret = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(kn) + 1) * sizeof(WCHAR));
LPWSTR ptr = ret;
if (!ptr) WINECON_Fatal("OOM");
if (!ret) return NULL;
do
{

View File

@ -56,8 +56,7 @@ static void WCUSER_FillMemDC(const struct inner_data* data, int upd_tp, int upd_
/* FIXME: could set up a mechanism to reuse the line between different
* calls to this function
*/
if (!(line = HeapAlloc(GetProcessHeap(), 0, data->curcfg.sb_width * sizeof(WCHAR))))
WINECON_Fatal("OOM\n");
if (!(line = HeapAlloc(GetProcessHeap(), 0, data->curcfg.sb_width * sizeof(WCHAR)))) return;
dx = HeapAlloc( GetProcessHeap(), 0, data->curcfg.sb_width * sizeof(*dx) );
hOldFont = SelectObject(PRIVATE(data)->hMemDC, PRIVATE(data)->hFont);
@ -169,7 +168,7 @@ static void WCUSER_ShapeCursor(struct inner_data* data, int size, int vis, BOOL
w16b = ((data->curcfg.cell_width + 15) & ~15) / 8;
ptr = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, w16b * data->curcfg.cell_height);
if (!ptr) WINECON_Fatal("OOM");
if (!ptr) return;
nbl = max((data->curcfg.cell_height * size) / 100, 1);
for (j = data->curcfg.cell_height - nbl; j < data->curcfg.cell_height; j++)
{

View File

@ -655,11 +655,7 @@ static struct inner_data* WINECON_Init(HINSTANCE hInst, DWORD pid, LPCWSTR appna
GetStartupInfoW(&si);
if (pid == 0)
{
if (!si.lpTitle) WINECON_Fatal("Should have a title set");
appname = si.lpTitle;
}
if (pid == 0) appname = si.lpTitle;
data->nCmdShow = nCmdShow;
/* load settings */
@ -729,7 +725,7 @@ static struct inner_data* WINECON_Init(HINSTANCE hInst, DWORD pid, LPCWSTR appna
WINECON_GetServerConfig(data);
data->cells = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
data->curcfg.sb_width * data->curcfg.sb_height * sizeof(CHAR_INFO));
if (!data->cells) WINECON_Fatal("OOM\n");
if (!data->cells) goto error;
data->fnResizeScreenBuffer(data);
data->fnComputePositions(data);
WINECON_SetConfig(data, &cfg);