Commit f01c43c4 authored by Marcus Meissner's avatar Marcus Meissner Committed by Alexandre Julliard

shlwapi: Handle NULL ptr return from allocation (Coverity).

parent fb1d5310
...@@ -4506,12 +4506,18 @@ INT WINAPIV ShellMessageBoxWrapW(HINSTANCE hInstance, HWND hWnd, LPCWSTR lpText, ...@@ -4506,12 +4506,18 @@ INT WINAPIV ShellMessageBoxWrapW(HINSTANCE hInstance, HWND hWnd, LPCWSTR lpText,
{ {
const WCHAR *ptr; const WCHAR *ptr;
UINT len = LoadStringW(hInstance, LOWORD(lpText), (LPWSTR)&ptr, 0); UINT len = LoadStringW(hInstance, LOWORD(lpText), (LPWSTR)&ptr, 0);
if (len) if (len)
{ {
szText = HeapAlloc(GetProcessHeap(), 0, (len + 1) * sizeof(WCHAR)); szText = HeapAlloc(GetProcessHeap(), 0, (len + 1) * sizeof(WCHAR));
if (szText) LoadStringW(hInstance, LOWORD(lpText), szText, len + 1); if (szText) LoadStringW(hInstance, LOWORD(lpText), szText, len + 1);
} }
pszText = szText; pszText = szText;
if (!pszText) {
WARN("Failed to load id %d\n", LOWORD(lpText));
__ms_va_end(args);
return 0;
}
} }
else else
pszText = lpText; pszText = lpText;
......
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