Re: [PATCH] mshtml: check for NULL return from allocations
1 Dec
2009
1 Dec
'09
11:02 p.m.
Hi Marcus, Marcus Meissner wrote:
Hi,
Coverity thinks we miss NULL checks and yes, we do. Added some.
(...)
- wstrbuf_init(&buf); + if (!wstrbuf_init(&buf)) + return E_OUTOFMEMORY; range_to_string(This, &buf); - if(buf.buf) - *p = SysAllocString(buf.buf); + *p = SysAllocString(buf.buf); wstrbuf_finish(&buf);
TRACE("ret %s\n", debugstr_w(*p)); + if (!*p) + return E_OUTOFMEMORY; return S_OK; }
This check is not meant to check allocation failure, but to check if range_to_string set it to NULL. We even have a tests for this. More error handling is a good thing to do, but this check should remain unchanged. Thanks, Jacek
5856
Age (days ago)
5856
Last active (days ago)
0 comments
1 participants
participants (1)
-
Jacek Caban