mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-06 09:35:52 +00:00
mshtml: Handle memory allocation failure in set_statustext.
This commit is contained in:
parent
d394df4a30
commit
4a8b12a1f6
|
@ -407,6 +407,7 @@ void set_statustext(HTMLDocumentObj* doc, INT id, LPCWSTR arg)
|
|||
if(!p) {
|
||||
len = 255;
|
||||
p = malloc(len * sizeof(WCHAR));
|
||||
if (!p) return;
|
||||
len = LoadStringW(hInst, id, p, len) + 1;
|
||||
p = realloc(p, len * sizeof(WCHAR));
|
||||
if(InterlockedCompareExchangePointer((void**)&status_strings[index], p, NULL)) {
|
||||
|
@ -420,6 +421,7 @@ void set_statustext(HTMLDocumentObj* doc, INT id, LPCWSTR arg)
|
|||
|
||||
len = lstrlenW(p) + lstrlenW(arg) - 1;
|
||||
buf = malloc(len * sizeof(WCHAR));
|
||||
if (!buf) return;
|
||||
|
||||
swprintf(buf, len, p, arg);
|
||||
|
||||
|
|
Loading…
Reference in a new issue